Browse Source

始宁农业管理后台:消息通知

panyong 2 years ago
parent
commit
939c05eefd

+ 2 - 11
htmldev/shiningWxMini/README.md

@@ -1,16 +1,7 @@
 ### todo List
 
-* 首页
-  - [ ] 优秀产品:缺批发价、零售价、推荐语
-
-* 收藏-商品列表
-  - [ ] 缺:商品主图、预售/现售、批发价、零售价、推荐语
-
-* 最新上架
-  - [ ] 缺:推荐语
-
-* 村长说农货
-  - [ ] 转发数据统计接口
+* 最新上架 /api/user/new/product/list
+  - [ ] 缺批发价、推荐标签
 
 * 农事天地
   - [ ] 评论:回复、删除

+ 9 - 10
htmldev/shiningWxMini/components/goods-item-large/index.wxml

@@ -14,24 +14,23 @@
     </view>
     <view class="name {{item.product_is_select === 1 ? 'has-tag' : ''}}">{{item.product_title}}</view>
   </view>
-  <!--  todo 缺字段 -->
-  <view class="dessciption">{{item.product_recommend_lable}}</view>
+  <view class="dessciption">{{item.product_desc}}</view>
   <view class="price-wrap">
     <view class="now">
       <view class="unit">¥</view>
-      <view class="yuan">{{tools.fen2YuanAndJiao(item.product_market_price).yuan}}</view>
-      <view class="jiao">{{tools.fen2YuanAndJiao(item.product_market_price).jiao}}</view>
+      <view class="yuan">{{tools.fen2YuanAndJiao(item.product_all_price).yuan}}</view>
+      <view class="jiao">{{tools.fen2YuanAndJiao(item.product_all_price).jiao}}</view>
     </view>
     <view class="old">¥{{tools.fen2Yuan(item.product_price)}}</view>
   </view>
-  <!-- todo 标签 -->
-  <view class="key-words-list" wx:if="{{false}}">
+  <view
+    class="key-words-list"
+    wx:if="{{tools.formatProductLable(item.product_lable).length > 0}}">
     <view
       class="key-words"
-      wx:for="{{3}}"
-      wx:key="item">
-      <image class="label" src="../../image/common/top1.png"></image>
-      <text class="value">销量高销量高销量高销量高</text>
+      wx:for="{{tools.formatProductLable(item.product_lable)}}"
+      wx:key="index">
+      <text class="value">{{item}}</text>
     </view>
   </view>
 </view>

+ 9 - 9
htmldev/shiningWxMini/components/goods-item-normal/index.scss

@@ -94,16 +94,16 @@
 }
 
 .star-words {
-  display: flex;
-  flex-flow: row wrap;
+  display: -webkit-box;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 2;
   margin-top: 16rpx;
-
-  .word {
-    margin-left: 6rpx;
-    font-size: 24rpx;
-    line-height: 32rpx;
-    color: rgba(183, 191, 206, 1);
-  }
+  font-size: 24rpx;
+  line-height: 32rpx;
+  color: rgba(183, 191, 206, 1);
+  word-break: break-all;
+  word-wrap: break-word;
+  overflow: hidden;
 }
 
 .key-words-list {

+ 6 - 9
htmldev/shiningWxMini/components/goods-item-normal/index.wxml

@@ -23,18 +23,15 @@
       </view>
       <view class="old">¥{{tools.fen2Yuan(item.product_price)}}</view>
     </view>
-    <view class="star-words">
-      <text
-        class="word">{{item.product_recommend_lable}}</text>
-    </view>
-    <!-- todo 标签 -->
-    <view class="key-words-list" wx:if="{{false}}">
+    <view class="star-words">{{item.product_desc}}</view>
+    <view
+      class="key-words-list"
+      wx:if="{{tools.formatProductLable(item.product_lable).length > 0}}">
       <view
         class="key-words"
-        wx:for="{{2}}"
+        wx:for="{{tools.formatProductLable(item.product_lable)}}"
         wx:key="item">
-        <image class="label" src=""></image>
-        <text class="value">销量高销量高销量高销量高</text>
+        <text class="value">{{item}}</text>
       </view>
     </view>
   </view>

+ 9 - 1
htmldev/shiningWxMini/components/wxs/index.wxs

@@ -135,6 +135,13 @@ function imgFilter(src) {
     : 'https://bashi-1311374120.cos.ap-shanghai.myqcloud.com/wxMini/image' + src
 }
 
+function formatProductLable(str) {
+  if (!str) {
+    return []
+  }
+  return str.split(',')
+}
+
 module.exports = {
   formatTs: formatTs,
   computedFormOrderCarCount: computedFormOrderCarCount,
@@ -143,5 +150,6 @@ module.exports = {
   fen2YuanAndJiao: fen2YuanAndJiao,
   mToKm: mToKm,
   cutDownTime: cutDownTime,
-  imgFilter: imgFilter
+  imgFilter: imgFilter,
+  formatProductLable: formatProductLable
 }

+ 1 - 1
htmldev/shiningWxMini/pages/businessDetail/businessDetail.js

@@ -23,7 +23,7 @@ Page({
         value: '2'
       }
     ],
-    active: '1',
+    active: '2',
     objShopDetail: { shop_address: {} },
     booLock: false
   },

+ 14 - 0
htmldev/shiningWxMini/pages/mediaDetail/api/index.js

@@ -29,3 +29,17 @@ export const postVideoComment = (videoId, videoComment) => request({
   },
   showLoading: true
 })
+
+/**
+ * 转发统计
+ * @param videoId
+ * @returns {Promise<*>}
+ */
+export const postTransferVideo = (videoId) => request({
+  url: '/api/user/transfer/video',
+  method: 'POST',
+  data: {
+    'video_id': videoId
+  },
+  showLoading: false
+})

+ 18 - 1
htmldev/shiningWxMini/pages/mediaDetail/mediaDetail.js

@@ -1,5 +1,5 @@
 const pages = require('../../mixin/pages')
-const { postvideoGood, postVideoComment } = require('./api/index')
+const { postvideoGood, postVideoComment, postTransferVideo } = require('./api/index')
 
 Page({
 
@@ -89,6 +89,7 @@ Page({
   },
   onShareAppMessage(options) {
     const { video_name, video_cover_url } = this.data.videoConfig
+    this.addTransferVideo()
 
     return {
       title: video_name,
@@ -174,6 +175,22 @@ Page({
       }
     } catch (err) {}
 
+    this.setData({
+      booLock: false
+    })
+  },
+  // 转发统计
+  async addTransferVideo() {
+    const { id } = this.data.videoConfig
+
+    this.setData({
+      booLock: true
+    })
+
+    try {
+      await postTransferVideo(id)
+    } catch (err) {}
+
     this.setData({
       booLock: false
     })