goods.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. <!-- 推广商品 -->
  2. <template>
  3. <view>
  4. <view style="color: #000000;">
  5. <tn-nav-bar backgroundColor="#ffffff" :bottomShadow="false">推广套餐</tn-nav-bar>
  6. <view :style="{height: tobheight+'px'}"></view>
  7. </view>
  8. <view class="promotion-goods-wrap">
  9. <view class="goods-list u-flex" v-for="(item, index) in goodsList" :key="item.goods_id"
  10. @tap="jump('/pages/goods/detail', { id: item.id })">
  11. <view class="img-box">
  12. <!-- <image class="goods-img" :src="appInfo.share_img_path" mode="aspectFill"></image> -->
  13. <u--image :showLoading="true" :src="appInfo.share_img_path" width="100px" height="100px"></u--image>
  14. </view>
  15. <view class="goods-info u-flex-col u-row-between">
  16. <view class="goods-title u-ellipsis-1">{{ item.title }}</view>
  17. <view class="goods-des u-ellipsis-1">{{ item.subtitle }}</view>
  18. <view class="goods-price u-flex font-OPPOSANS">
  19. <view class="price">¥{{ item.price }}</view>
  20. <view class="origin-price">¥{{ item.original_price }}</view>
  21. </view>
  22. <view class="commission-num">
  23. 预计佣金:¥{{ Math.round(((item.price * (ruleInfo.first/100))) * 100) / 100 == 0?'低于0.01': Math.round(((item.price * (ruleInfo.first/100))) * 100) / 100}}
  24. </view>
  25. <!-- <view class="">{{Math.round((0.1*(ruleInfo.first/100)) * 100) / 100}}</view> -->
  26. </view>
  27. <!-- #ifdef H5 -->
  28. <button class="share-btn u-reset-button" @click.stop="h5share = true">分享赚</button>
  29. <!-- #endif -->
  30. <!-- #ifdef MP-WEIXIN -->
  31. <button class="share-btn u-reset-button" open-type="share">分享赚</button>
  32. <!-- #endif -->
  33. </view>
  34. <!-- 分享组件 -->
  35. <!-- <shopro-share v-model="showShare" :posterInfo="posterInfo" :posterType="'goods'"></shopro-share> -->
  36. <!-- 缺省页 -->
  37. <!-- <shopro-empty v-if="isEmpty" :image="$IMG_URL + '/imgs/empty/no_data.png'" tipText="暂无数据"></shopro-empty> -->
  38. <!-- 更多 -->
  39. <u-loadmore height="80rpx" status="'nomore'" icon-type="flower" color="#ccc" />
  40. </view>
  41. <!-- #ifdef H5 -->
  42. <u-popup :show="h5share" mode="center" @close="h5share = false">
  43. <view class="cu-dialog">
  44. <image class="guide-img" src="http://shopro.7wpp.com/imgs/modal/share_guide.png" mode=""></image>
  45. </view>
  46. </u-popup>
  47. <!-- #endif -->
  48. <wike-loading-page :isLoading="isLoading"></wike-loading-page>
  49. </view>
  50. </template>
  51. <script>
  52. import {
  53. mapMutations,
  54. mapActions,
  55. mapState,
  56. mapGetters
  57. } from 'vuex';
  58. export default {
  59. components: {},
  60. data() {
  61. return {
  62. tobheight: 45,
  63. platform: this.$platform.get(),
  64. showShare: false, //是否分享
  65. posterInfo: {}, //分享信息
  66. goodsList: [], //分销商品
  67. loadStatus: 'nomore', //loadmore-加载前的状态,loading-加载中的状态,nomore-没有更多的状态
  68. currentPage: 1,
  69. lastPage: 1,
  70. isEmpty: false,
  71. ruleInfo: {},
  72. h5share: false,
  73. type: 1,
  74. isLoading: true
  75. };
  76. },
  77. computed: {
  78. ...mapGetters(['appInfo', 'userInfo', 'isLogin'])
  79. },
  80. onLoad() {
  81. const that = this;
  82. if (this.platform == 'wxMiniProgram') {
  83. var menumtop = uni.getMenuButtonBoundingClientRect().top - uni.getSystemInfoSync().statusBarHeight
  84. var paddingtop = uni.getSystemInfoSync().statusBarHeight + menumtop
  85. this.tobheight = (menumtop + paddingtop + uni.getMenuButtonBoundingClientRect().height)
  86. }
  87. this.getWithdrawRules();
  88. this.getGoodList()
  89. },
  90. // onUnload() {
  91. // share.setShareInfo();
  92. // },
  93. // onReachBottom() {
  94. // if (this.currentPage < this.lastPage) {
  95. // this.currentPage += 1;
  96. // this.getGoodList();
  97. // }
  98. // },
  99. onShow() {
  100. if (!this.isLogin) {
  101. uni.navigateTo({
  102. url: '../user/signin'
  103. });
  104. }
  105. },
  106. methods: {
  107. getWithdrawRules() {
  108. let that = this;
  109. that.$http('conf.getGroupConf', {
  110. group: 'system.commission'
  111. }).then(res => {
  112. if (res.code === 0) {
  113. that.ruleInfo = res.data;
  114. console.log('that.ruleInfo', that.ruleInfo);
  115. uni.setNavigationBarTitle({
  116. title: that.appInfo.site_name
  117. });
  118. // that.selectedWithdrawType = that.ruleInfo.methods[0];
  119. }
  120. });
  121. },
  122. jump(path, parmas) {
  123. this.$Router.push({
  124. path: path,
  125. query: parmas
  126. });
  127. },
  128. getGoodList() {
  129. let that = this;
  130. that.loadStatus = 'loading';
  131. that.$http('member.list', {
  132. type: that.type
  133. }).then(res => {
  134. if (res.code === 0) {
  135. if (that.type < 2) {
  136. that.type++
  137. that.getGoodList()
  138. }
  139. that.goodsList = [...that.goodsList, ...res.data];
  140. // that.lastPage = res.data.last_page;
  141. // that.isEmpty = !that.goodsList.length;
  142. // that.loadStatus = that.currentPage < res.data.last_page ? 'loadmore' : 'nomore';
  143. } else {
  144. uni.showToast({
  145. title: '暂无数据',
  146. icon: 'none'
  147. })
  148. }
  149. this.isLoading = false
  150. });
  151. }
  152. }
  153. };
  154. </script>
  155. <style lang="scss">
  156. page {
  157. background-color: #fff;
  158. }
  159. // 推广商品列表
  160. .goods-list {
  161. padding: 30rpx;
  162. border-bottom: 1rpx solid rgba(#dfdfdf, 0.5);
  163. position: relative;
  164. .share-btn {
  165. position: absolute;
  166. bottom: 30rpx;
  167. right: 30rpx;
  168. width: 160rpx;
  169. line-height: 60rpx;
  170. background: linear-gradient(90deg, #a36fff, #5336ff);
  171. box-shadow: 0px 7rpx 11rpx 2rpx rgba(124, 103, 214, 0.34);
  172. border-radius: 30rpx;
  173. font-size: 28rpx;
  174. color: #fff;
  175. font-weight: 500;
  176. }
  177. .img-box {
  178. // border: 1rpx solid rgba(223, 223, 223, 0.43);
  179. margin-right: 30rpx;
  180. .goods-img {
  181. width: 200rpx;
  182. height: 200rpx;
  183. }
  184. }
  185. .goods-info {
  186. align-items: flex-start;
  187. height: 200rpx;
  188. .goods-title {
  189. width: 400rpx;
  190. font-size: 28rpx;
  191. font-weight: 500;
  192. color: #333333;
  193. margin-bottom: 10rpx;
  194. }
  195. .goods-des {
  196. width: 400rpx;
  197. font-size: 22rpx;
  198. font-weight: 500;
  199. color: #a8700d;
  200. margin-bottom: 10rpx;
  201. }
  202. .goods-price {
  203. margin-bottom: 10rpx;
  204. .price {
  205. font-size: 28rpx;
  206. font-weight: 500;
  207. color: #333333;
  208. margin-right: 16rpx;
  209. }
  210. .origin-price {
  211. font-size: 24rpx;
  212. font-weight: 400;
  213. text-decoration: line-through;
  214. color: #999999;
  215. }
  216. }
  217. .commission-num {
  218. font-size: 24rpx;
  219. font-weight: 500;
  220. color: #5e4ddf;
  221. }
  222. }
  223. }
  224. .cu-dialog {
  225. position: fixed;
  226. top: 60rpx;
  227. left: 100rpx;
  228. }
  229. .guide-img {
  230. width: 580rpx;
  231. height: 430rpx;
  232. }
  233. </style>