liveDetail1.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819
  1. <template>
  2. <view class="container">
  3. <trtc-room ref="trtc-component" :config="rtcConfig"> </trtc-room>
  4. <view class="top_box" :style="{ top: btn_top, left: btn_left}">
  5. <image class="top_box_img" :src="head_img"></image>
  6. <view class="top_box_text">
  7. <text class="text_box_top">{{title}}</text><text class="text_box_bottom" >{{user_name}}</text>
  8. </view>
  9. </view>
  10. <view class="popup-flip" @click="changeCamera()">
  11. <view class="iconfont iconFill"></view>
  12. </view>
  13. <view class="popup-open" @click="popupShow = true">
  14. <view class="iconfont iconzhibo-shangpin"></view>
  15. </view>
  16. <u-popup v-model="popupShow" mode="bottom">
  17. <view class="popup-box">
  18. <view class="popup-close" @click="popupShow = false">收起</view>
  19. <view class="popup-edit" @click="bindGood()">绑定</view>
  20. <scroll-view scroll-y="true" class="good-select-box">
  21. <view class="select-good-row" v-for="(item, index) in goodList" :key="index">
  22. <view class="good-check">
  23. <view class="iconfont" :class="item.check ? 'iconqueding' : 'iconfeigouxuan'" @click="checkGoods(item)"></view>
  24. </view>
  25. <view class="good-card" style="width: calc(100% - 60px);">
  26. <image class="goods-img" :src="item.imgPath" mode="aspectFill"></image>
  27. <view class="good-info">
  28. <view class="good-name">{{item.productName}}</view>
  29. <view class="good-text">销量:{{item.sellCount}}</view>
  30. <view class="good-price">
  31. <text class="goods-spec">¥{{item.bizPrice}}/{{item.unit}}</text>
  32. <text class="goods-original">原价:{{item.originalPrice}}</text>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </scroll-view>
  38. </view>
  39. </u-popup>
  40. <u-top-tips ref="uTips"></u-top-tips>
  41. <view class="talk_box" :style="{ left: btn_left}">
  42. <view class="line_box" v-for="(item, index) in text_list" :key="index">
  43. <view class="talk_box_timp" >
  44. <image :src="item.description"></image>
  45. <text>{{item.extension}}:{{item.data}}</text>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="talk_input" :style="{ left: btn_left}">
  50. <view class="talk_box_timp" style="width: 60%;height: 80rpx;padding: 10rpx;">
  51. <input placeholder="说点什么..." placeholder-style="color:#fff" :value="send_value" type='text' confirm-type="send" @confirm="sendsms_fun" @input="getVal"/>
  52. </view>
  53. </view>
  54. </view>
  55. </template>
  56. <script>
  57. const NET = require('@/utils/request')
  58. const API = require('@/config/api')
  59. import {
  60. genTestUserSig,
  61. setData
  62. } from "@/pagesMedia/debug/GenerateTestUserSig";
  63. import trtcRoom from "@/pagesMedia/trtc-room/trtc-room";
  64. export default {
  65. components: {
  66. trtcRoom
  67. },
  68. data() {
  69. return {
  70. text_list:[
  71. //{description:'https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTJc8RKCs43SAHMkh1bxVR3WTCr0MRkPCQkhlPrhA6Zhib1l5BouSIW0g6su8ia1cNVKhC2IZmM5humA/132',extension:'1111',data:'323123'}
  72. ],
  73. first_gx:true,
  74. send_value:'',
  75. roomID: '',
  76. liveId: '',
  77. popupShow: false,
  78. goodList: [],
  79. rtcConfig: {
  80. sdkAppID: '',
  81. // 必要参数 开通实时音视频服务创建应用后分配的 sdkAppID
  82. userID: '',
  83. // 必要参数 用户 ID 可以由您的帐号系统指定
  84. userSig: '',
  85. // 必要参数 身份签名,相当于登录密码的作用
  86. template: '' // 必要参数 组件模版,支持的值 1v1 grid custom ,注意:不支持动态修改, iOS 不支持 pusher 动态渲染
  87. },
  88. showTipToast: false,
  89. options: {},
  90. btn_left:0,
  91. btn_top:0,
  92. title:"",
  93. user_name:'0',
  94. head_img:"../static/images/loginLogo.png"
  95. }
  96. },
  97. onLoad(options) {
  98. this.liveId = options.liveId
  99. NET.request(API.getBindedLiveGoods, {
  100. liveId: this.liveId
  101. }, 'GET').then(res => {
  102. let goodsIds = res.data.map(site => {
  103. return site.productId
  104. }).join(',')
  105. this.getAllGoods(goodsIds)
  106. }).catch(res => {
  107. this.$refs.uTips.show({
  108. title: '获取已绑定商品失败',
  109. type: 'warning',
  110. })
  111. })
  112. NET.request(API.creatLive, {
  113. liveId: this.liveId,
  114. liveStatus: 1
  115. }, 'GET').then(res => {}).catch(res => {
  116. this.$refs.uTips.show({
  117. title: '开启直播失败',
  118. type: 'warning',
  119. })
  120. })
  121. NET.request(API.startLivePushMessage + options.liveId, {}, 'GET').then(res => {
  122. //this.goodsList = res.data
  123. }).catch(res => {
  124. })
  125. },
  126. onReady() {
  127. var that=this;
  128. let menuButtonObject = wx.getMenuButtonBoundingClientRect();
  129. let userData = uni.getStorageSync("userData")
  130. wx.getSystemInfo({
  131. success: res => {
  132. this.setData({
  133. btn_left: res.windowWidth - menuButtonObject.right+'px',
  134. btn_top:menuButtonObject.top+menuButtonObject.height+14+'rpx'
  135. })
  136. },
  137. })
  138. wx.setKeepScreenOn({
  139. keepScreenOn: true
  140. }); // 获取 rtcroom 实例
  141. this.trtcComponent = this.$refs['trtc-component']; // 监听TRTC Room 关键事件
  142. this.bindTRTCRoomEvent(); // 将String 类型的 true false 转换成 boolean
  143. this.options.localAudio = true; //开启麦克风
  144. this.options.localVideo = true; //开启视频
  145. NET.request(API.getLiveData + this.liveId, {}, 'POST').then(res => {
  146. this.enterRoom({
  147. roomID: Number(res.data.roomId),
  148. userID: uni.getStorageSync("userData").userId,
  149. template: "grid",
  150. });
  151. this.setData({
  152. head_img:res.data.imgUrl,
  153. title:res.data.liveName,
  154. roomID:Number(res.data.roomId)
  155. })
  156. }).catch(res => {
  157. this.$refs.uTips.show({
  158. title: '获取直播设置参数失败',
  159. type: 'warning',
  160. })
  161. })
  162. },
  163. onUnload() {
  164. NET.request(API.creatLive, {
  165. liveId: this.liveId,
  166. liveStatus: 2
  167. }, 'GET').then(res => {}).catch(res => {
  168. this.$refs.uTips.show({
  169. title: '关闭直播失败',
  170. type: 'warning',
  171. })
  172. })
  173. },
  174. methods: {
  175. getVal(e) {
  176. let {
  177. value
  178. } = e.detail
  179. this.send_value = value;
  180. },
  181. sendsms_fun:function(){
  182. /*this.trtcComponent.sendGroupTextMessage({
  183. roomID: Number(this.data.roomID), // 房间 ID
  184. message: this.data.title,
  185. })*/
  186. if(Number(wx.getStorageSync('jy_time'))>(new Date()).valueOf()){
  187. wx.showToast({
  188. title: "禁言中,不能发言",
  189. icon: 'none'
  190. })
  191. return false;
  192. }
  193. this.trtcComponent.sendGroupCustomMessage({
  194. roomID: Number(this.roomID), // 房间 ID
  195. payload: {
  196. data: this.send_value,
  197. description: uni.getStorageSync("userData").headImage,
  198. extension: uni.getStorageSync("userData").userName
  199. }
  200. })
  201. var that=this;
  202. console.log("new_log",uni.getStorageSync("userData"))
  203. var temp={
  204. data: this.send_value,
  205. description: uni.getStorageSync("userData").headImage,
  206. extension: uni.getStorageSync("userData").userName
  207. };
  208. var data=that.text_list;
  209. if(data.length==5){
  210. data.shift();
  211. }
  212. data.push(temp);
  213. this.setData({
  214. text_list:data,
  215. });
  216. this.setData({
  217. send_value:'',
  218. });
  219. },
  220. // 勾选商品
  221. checkGoods(site) {
  222. site.check = !site.check
  223. },
  224. // 获取可绑定商品
  225. getAllGoods(goodsIds) {
  226. NET.request(API.getVideoGoods, {}, 'GET').then(res => {
  227. res.data.forEach(site => {
  228. site.check = goodsIds.indexOf(site.productId) != -1
  229. })
  230. this.goodList = res.data
  231. }).catch(res => {
  232. this.$refs.uTips.show({
  233. title: '获取可绑定商品失败',
  234. type: 'warning',
  235. })
  236. })
  237. },
  238. // 绑定商品
  239. bindGood() {
  240. NET.request(API.bindLiveGoods, {
  241. liveId: this.liveId,
  242. prudoctIds: this.goodList.filter(site => site.check).map(site => {
  243. return site.productId
  244. })
  245. }, 'POST').then(res => {
  246. this.popupShow = false
  247. this.$refs.uTips.show({
  248. title: '设置成功',
  249. type: 'success',
  250. })
  251. }).catch(res => {
  252. this.$refs.uTips.show({
  253. title: '设置失败',
  254. type: 'warning',
  255. })
  256. })
  257. },
  258. setData,
  259. enterRoom: function(params) {
  260. params.template = params.template || '1v1';
  261. params.roomID = params.roomID || 2333;
  262. params.userID = params.userID || new Date().getTime().toString(16);
  263. console.log('* room enterRoom', params);
  264. const Signature = genTestUserSig(params.userID);
  265. params.sdkAppID = Signature.sdkAppID;
  266. params.userSig = Signature.userSig;
  267. this.template = params.template;
  268. this.rtcConfig = {
  269. sdkAppID: params.sdkAppID,
  270. // 您的实时音视频服务创建应用后分配的 sdkAppID
  271. userID: params.userID,
  272. userSig: params.userSig,
  273. template: params.template,
  274. // 1v1 grid custom
  275. debugMode: false,
  276. // 非必要参数,打开组件的调试模式,开发调试时建议设置为 true
  277. // cloudenv: params.cloudenv, // 非必要参数
  278. frontCamera: "front",
  279. enableEarMonitor: false,
  280. enableAutoFocus: true,
  281. localMirror: 'auto',
  282. enableAgc: true,
  283. enableAns: true,
  284. encsmall: false ? 1 : 0,
  285. videoWidth: 1280,
  286. videoHeight: 720,
  287. scene: "live",
  288. maxBitrate: 2000,
  289. minBitrate: 1500,
  290. beautyLevel: 9, // 默认开启美颜
  291. enableIM: true, // 用于组件内渲染
  292. showIMPanel: false,
  293. exitIMThrottle: false,
  294. messageContent: '',
  295. messageList: [], // 仅保留10条消息
  296. maxMessageListLength: 10,
  297. messageListScrollTop: 0
  298. };
  299. this.setData({
  300. rtcConfig: this.rtcConfig
  301. }, () => {
  302. // roomID 取值范围 1 ~ 4294967295
  303. this.trtcComponent.enterRoom({
  304. roomID: params.roomID
  305. }).then(() => {
  306. if (this.template === 'custom') {
  307. // 设置推流端视窗的坐标和尺寸
  308. this.trtcComponent.setViewRect({
  309. userID: params.userID,
  310. xAxis: '480rpx',
  311. yAxis: '160rpx',
  312. width: '240rpx',
  313. height: '320rpx'
  314. });
  315. }
  316. }).catch(res => {
  317. console.error('* room joinRoom 进房失败:', res);
  318. });
  319. });
  320. },
  321. setNum:function(){
  322. var that=this;
  323. let promise = that.trtcComponent.tim.getGroupProfile({ groupID: this.roomID+"" });
  324. promise.then(function(imResponse) {
  325. that.setData({
  326. user_name:(Number(imResponse.data.group.memberCount)-1)
  327. })
  328. console.log(imResponse.data.group);
  329. }).catch(function(imError) {
  330. console.warn('getGroupProfile error:', imError); // 获取群详细资料失败的相关信息
  331. });
  332. },
  333. bindTRTCRoomEvent: function() {
  334. const TRTC_EVENT = this.trtcComponent.EVENT;
  335. this.timestamp = []; // 初始化事件订阅
  336. this.trtcComponent.on(TRTC_EVENT.LOCAL_JOIN, event => {
  337. let user_list=this.trtcComponent.getRemoteUserList();
  338. this.setData({
  339. user_name:user_list.length
  340. })
  341. console.log('* room LOCAL_JOIN', event); // 进房成功,触发该事件后可以对本地视频和音频进行设置
  342. if (this.options.localVideo === true || this.options.template === '1v1') {
  343. this.trtcComponent.publishLocalVideo();
  344. }
  345. if (this.options.localAudio === true || this.options.template === '1v1') {
  346. this.trtcComponent.publishLocalAudio();
  347. }
  348. });
  349. this.trtcComponent.on(TRTC_EVENT.LOCAL_LEAVE, event => {
  350. console.log('* room LOCAL_LEAVE', event);
  351. });
  352. this.trtcComponent.on(TRTC_EVENT.ERROR, event => {
  353. console.log('* room ERROR', event);
  354. }); // 远端用户进房
  355. this.trtcComponent.on(TRTC_EVENT.REMOTE_USER_JOIN, event => {
  356. let user_list=this.trtcComponent.getRemoteUserList();
  357. this.setData({
  358. user_name:user_list.length
  359. })
  360. console.log('* room REMOTE_USER_JOIN --- room.vue', event, this.trtcComponent.getRemoteUserList(), this.template);
  361. this.timestamp.push(new Date()); // 1v1视频通话时限制人数为两人的简易逻辑,建议通过后端实现房间人数管理
  362. // 2人以上同时进行通话请选择网格布局
  363. if (this.template === '1v1' && this.timestamp.length > 1) {
  364. const interval = this.timestamp[1] - this.timestamp[0];
  365. if (interval < 1000) {
  366. // 房间里已经有两个人
  367. this.setData({
  368. showTipToast: true
  369. }, () => {
  370. setTimeout(() => {
  371. this.setData({
  372. showTipToast: false
  373. });
  374. wx.navigateBack({
  375. delta: 1
  376. });
  377. }, 4000);
  378. });
  379. }
  380. }
  381. }); // 远端用户退出
  382. this.trtcComponent.on(TRTC_EVENT.REMOTE_USER_LEAVE, event => {
  383. let user_list=this.trtcComponent.getRemoteUserList();
  384. this.setData({
  385. user_name:user_list.length
  386. })
  387. console.log('* room REMOTE_USER_LEAVE', event, this.trtcComponent.getRemoteUserList());
  388. if (this.template === '1v1') {
  389. this.timestamp = [];
  390. }
  391. if (this.template === '1v1' && this.remoteUser === event.data.userID) {
  392. this.remoteUser = null;
  393. }
  394. }); // 远端用户推送视频
  395. this.trtcComponent.on(TRTC_EVENT.REMOTE_VIDEO_ADD, event => {
  396. console.log('* room REMOTE_VIDEO_ADD', event, this.trtcComponent.getRemoteUserList()); // 订阅视频
  397. const userList = this.trtcComponent.getRemoteUserList();
  398. const data = event.data;
  399. if (this.template === '1v1' && (!this.remoteUser || this.remoteUser === data.userID)) {
  400. // 1v1 只订阅第一个远端流
  401. this.remoteUser = data.userID;
  402. this.trtcComponent.subscribeRemoteVideo({
  403. userID: data.userID,
  404. streamType: data.streamType
  405. });
  406. } else if (this.template === 'grid') {
  407. this.trtcComponent.subscribeRemoteVideo({
  408. userID: data.userID,
  409. streamType: data.streamType
  410. });
  411. }
  412. if (this.template === 'custom' && data.userID && data.streamType) {
  413. let index = userList.findIndex(item => {
  414. return item.userID === data.userID;
  415. });
  416. index++;
  417. const y = 320 * index + 160; // 设置远端视图坐标和尺寸
  418. this.trtcComponent.setViewRect({
  419. userID: data.userID,
  420. streamType: data.streamType,
  421. xAxis: '480rpx',
  422. yAxis: y + 'rpx',
  423. width: '240rpx',
  424. height: '320rpx'
  425. });
  426. }
  427. }); // 远端用户取消推送视频
  428. this.trtcComponent.on(TRTC_EVENT.REMOTE_VIDEO_REMOVE, event => {
  429. console.log('* room REMOTE_VIDEO_REMOVE', event, this.trtcComponent.getRemoteUserList());
  430. }); // 远端用户推送音频
  431. this.trtcComponent.on(TRTC_EVENT.REMOTE_AUDIO_ADD, event => {
  432. console.log('* room REMOTE_AUDIO_ADD', event, this.trtcComponent.getRemoteUserList()); // 订阅音频
  433. const data = event.data;
  434. if (this.template === '1v1' && (!this.remoteUser || this.remoteUser === data.userID)) {
  435. this.remoteUser = data.userID;
  436. this.trtcComponent.subscribeRemoteAudio({
  437. userID: data.userID
  438. });
  439. } else if (this.template === 'grid' || this.template === 'custom') {
  440. this.trtcComponent.subscribeRemoteAudio({
  441. userID: data.userID
  442. });
  443. } // 如果不订阅就不会自动播放音频
  444. // this.trtcComponent.subscribeRemoteAudio({ userID: data.userID })
  445. }); // 远端用户取消推送音频
  446. this.trtcComponent.on(TRTC_EVENT.REMOTE_AUDIO_REMOVE, event => {
  447. console.log('* room REMOTE_AUDIO_REMOVE', event, this.trtcComponent.getRemoteUserList());
  448. });
  449. this.trtcComponent.on(TRTC_EVENT.IM_READY, event => {
  450. console.log('* room IM_READY', event)
  451. var that=this;
  452. if(event.data.name=="onMessageReceived"){
  453. setTimeout(function(){
  454. if(that.first_gx){
  455. that.first_gx=false;
  456. that.setNum();
  457. }
  458. },3000)
  459. }
  460. })
  461. this.trtcComponent.on(TRTC_EVENT.IM_MESSAGE_RECEIVED, event => {
  462. var that=this;
  463. if(event.data.data==undefined){
  464. return false;
  465. }
  466. if(event.data.data[0]==undefined){
  467. return false;
  468. }
  469. if(event.data.data[0].type=="TIMCustomElem"){
  470. if(event.data.data[0].payload.description==0||event.data.data[0].payload.description==1||event.data.data[0].payload.description==2||event.data.data[0].payload.description==3){
  471. var user_id=wx.getStorageSync('uid');
  472. if(event.data.data[0].payload.data==user_id){
  473. var jy_time=0;
  474. if(event.data.data[0].payload.description==0){
  475. jy_time=(new Date()).valueOf()+5*60*1000;
  476. }
  477. if(event.data.data[0].payload.description==1){
  478. jy_time=(new Date()).valueOf()+10*60*1000;
  479. }
  480. if(event.data.data[0].payload.description==2){
  481. jy_time=(new Date()).valueOf()+30*60*1000;
  482. }
  483. if(event.data.data[0].payload.description==3){
  484. jy_time=(new Date()).valueOf()+60*60*1000;
  485. }
  486. wx.setStorageSync('jy_time', jy_time)
  487. }
  488. wx.showToast({
  489. title: event.data.data[0].payload.extension,
  490. icon: 'none'
  491. })
  492. }else{
  493. var temp=event.data.data[0].payload;
  494. if(temp.data=="genxin"){
  495. setTimeout(function(){
  496. that.setNum();
  497. },3000)
  498. return false;
  499. }
  500. var data=that.text_list;
  501. if(data.length==5){
  502. data.shift();
  503. }
  504. data.push(temp);
  505. this.setData({
  506. text_list:data,
  507. });
  508. }
  509. }
  510. })
  511. },
  512. changeCamera: function() {
  513. this.trtcComponent.switchCamera();
  514. }
  515. },
  516. }
  517. </script>
  518. <style lang="less" scoped>
  519. page {
  520. width: 100%;
  521. height: 100%;
  522. }
  523. .container {
  524. width: 100%;
  525. height: 100%;
  526. float: left;
  527. position: relative;
  528. .popup-flip {
  529. width: 50px;
  530. height: 50px;
  531. position: fixed;
  532. top: 15px;
  533. right: 15px;
  534. background: #52A63A;
  535. border-radius: 50%;
  536. text-align: center;
  537. line-height: 50px;
  538. z-index: 10000;
  539. .iconFill {
  540. color: #FFFFFF;
  541. font-size: 34px;
  542. }
  543. }
  544. .popup-open {
  545. width: 50px;
  546. height: 50px;
  547. position: fixed;
  548. bottom: 15px;
  549. right: 15px;
  550. background: #52A63A;
  551. border-radius: 50%;
  552. text-align: center;
  553. line-height: 50px;
  554. z-index: 10000;
  555. .iconzhibo-shangpin {
  556. color: #FFFFFF;
  557. font-size: 34px;
  558. }
  559. }
  560. .popup-box {
  561. width: 100%;
  562. height: 400px;
  563. float: left;
  564. background-color: #FFFFFF;
  565. border-radius: 15px 15px 0px 0px;
  566. box-sizing: border-box;
  567. padding: 16px 0 0 0;
  568. position: relative;
  569. .popup-close {
  570. width: 50%;
  571. height: 26px;
  572. float: left;
  573. box-sizing: border-box;
  574. padding: 10px 15px 0 15px;
  575. font-size: 15px;
  576. font-family: PingFang SC;
  577. color: #52A63A;
  578. line-height: 16px;
  579. margin-bottom: 10px;
  580. }
  581. .popup-edit {
  582. width: 50%;
  583. height: 26px;
  584. float: right;
  585. box-sizing: border-box;
  586. padding: 10px 15px 0 15px;
  587. font-size: 15px;
  588. font-family: PingFang SC;
  589. color: #52A63A;
  590. line-height: 16px;
  591. margin-bottom: 10px;
  592. text-align: right;
  593. }
  594. .good-select-box {
  595. width: 100%;
  596. height: 400px;
  597. float: left;
  598. overflow-y: auto;
  599. padding: 40px 0 10px 0;
  600. }
  601. .select-good-row {
  602. width: 100%;
  603. height: 114px;
  604. float: left;
  605. }
  606. .good-check {
  607. width: 30px;
  608. height: 104px;
  609. float: left;
  610. line-height: 104px;
  611. margin-right: 10px;
  612. .iconfont {
  613. font-size: 40px;
  614. text-align: right;
  615. color: #51A539;
  616. }
  617. }
  618. .good-card {
  619. width: 100%;
  620. float: left;
  621. margin: 5px;
  622. background: #FFFFFF;
  623. border-radius: 15px;
  624. box-shadow: 0px 1px 5px 0px rgba(102, 102, 102, 0.43);
  625. padding: 12px;
  626. box-sizing: border-box;
  627. .goods-img {
  628. width: 80px;
  629. height: 80px;
  630. float: left;
  631. border-radius: 10px;
  632. object-fit: cover;
  633. }
  634. .good-info {
  635. width: calc(100% - 86px);
  636. height: 80px;
  637. float: right;
  638. .good-name {
  639. width: 100%;
  640. height: 40px;
  641. float: left;
  642. font-size: 15px;
  643. font-family: PingFang SC;
  644. color: #333333;
  645. line-height: 20px;
  646. overflow: hidden;
  647. text-overflow: ellipsis;
  648. display: -webkit-box;
  649. -webkit-line-clamp: 2;
  650. -webkit-box-orient: vertical;
  651. word-wrap: break-word;
  652. }
  653. .good-price {
  654. width: 100%;
  655. height: 20px;
  656. float: left;
  657. line-height: 20px;
  658. font-family: PingFang SC;
  659. white-space: nowrap;
  660. margin: 3px 0 3px 0;
  661. .goods-spec {
  662. font-size: 15px;
  663. color: #52A63A;
  664. margin-right: 6px;
  665. }
  666. .goods-original {
  667. font-size: 12px;
  668. text-decoration: line-through;
  669. color: #A67954;
  670. }
  671. }
  672. }
  673. }
  674. }
  675. .top_box{
  676. width: 304rpx;
  677. height: 86rpx;
  678. position: absolute;
  679. z-index: 100;
  680. background:rgba(0, 0, 0, 0.4);
  681. border-radius: 100px;
  682. top: 182rpx;
  683. left: 30rpx;
  684. }
  685. .top_box_img{
  686. width: 86rpx;
  687. height: 86rpx;
  688. border-radius: 100rpx;
  689. float: left;
  690. }
  691. .top_box_text{
  692. float: left;
  693. color: #fff;
  694. margin-left: 30rpx;
  695. width: 180rpx;
  696. padding-top: 2rpx;
  697. }
  698. .text_box_top{
  699. font-size: 28rpx;
  700. width: 100%;
  701. display: block;
  702. height: 30rpx;
  703. float: left;
  704. margin-top: 6rpx;
  705. }
  706. .text_box_bottom{
  707. font-size: 22rpx;
  708. float: left;
  709. margin-top: 10rpx;
  710. }
  711. .tx_btn{
  712. background: #4fa237;
  713. display: inline-block;
  714. height: 70rpx;
  715. margin-top: 5rpx;
  716. border-radius: 60rpx;
  717. line-height: 70rpx;
  718. padding: 0 30rpx;
  719. margin-left: 30rpx;
  720. }
  721. .tx_btn image{
  722. width: 60rpx;
  723. height: 60rpx;
  724. margin-top: 5rpx;
  725. margin-right: 20rpx;
  726. }
  727. .tixingn{
  728. font-size: 34rpx;
  729. display: flex;
  730. }
  731. .tixingn:before {
  732. font-size: 60rpx;
  733. }
  734. .talk_box{
  735. z-index: 10;
  736. position: absolute;
  737. bottom: 30rpx;
  738. left: 0rpx;
  739. }
  740. .line_box{
  741. width:100%
  742. }
  743. .talk_box_timp{
  744. display: inline-block;
  745. border-radius: 60rpx;
  746. background: rgba(0, 0, 0, 0.4);
  747. margin-bottom: 10rpx;
  748. }
  749. .talk_box_timp image{
  750. width: 56rpx;
  751. height: 56rpx;
  752. border-radius: 60rpx;
  753. float: left;
  754. }
  755. .talk_box_timp text{
  756. float: left;
  757. color: #fff;
  758. padding-top: 6rpx;
  759. padding-right: 50rpx;
  760. font-size: 28rpx;
  761. margin-left: 20rpx;
  762. line-height: 45rpx;
  763. }
  764. .talk_input{
  765. display:none;
  766. z-index: 10;
  767. position: absolute;
  768. bottom: 38rpx;
  769. left: 0rpx;
  770. width:100%
  771. }
  772. .talk_box_timp input{
  773. float: left;
  774. color: #fff;
  775. padding-top: 6rpx;
  776. padding-right: 50rpx;
  777. font-size: 30rpx;
  778. margin-left: 20rpx;
  779. line-height: 45rpx;
  780. line-height: 34rpx;
  781. }
  782. }
  783. </style>