goods.vue 6.0 KB

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