多租户商城-商户小程序端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

294 lines
5.7 KiB

2 years ago
2 years ago
  1. <template>
  2. <view class="container">
  3. <global-loading />
  4. <view>
  5. <view v-for="(item, index) in Productlist" :key="index" class="goodsDetails-box flex-display flex-column mar-left-30"
  6. @click="goodsDatails(item)">
  7. <view class="goodsDetails flex-items-plus flex-row mar-top-30">
  8. <image class="goodsImg" :src="item.image"></image>
  9. <view class="mar-left-30">
  10. <view class="goodsName-box overflowNoDot">
  11. <label class="goodsName fs26 mar-left-20">{{item.productName}}</label>
  12. </view>
  13. <view class="priceBuyNum-box mar-top-20">
  14. <label class="fs24 font-color-C5AA7B">¥</label>
  15. <label class="fs36 font-color-C5AA7B mar-left-10">{{item.price}}</label>
  16. <label class="fs24 font-color-999 mar-left-20" v-if="item.users != null">{{item.users}}{{$t('common.payticktip')}}</label>
  17. <label class="fs24 font-color-999 mar-left-20" v-else>0{{$t('common.payticktip')}}</label>
  18. </view>
  19. <view class="fenxiang" @click.stop="fenxiang(item)">
  20. 分享
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. const NET = require('../../utils/request')
  30. const API = require('../../config/api')
  31. import tkiQrcode from '@/components/tki-qrcode/tki-qrcode.vue'
  32. export default {
  33. data() {
  34. return {
  35. Productlist: [],
  36. item:{},
  37. fenxiangitem: {},
  38. show: false,
  39. erweima: '',
  40. tuimgs:'',
  41. size: 160, // 二维码大小
  42. onval: true, // val值变化时自动重新生成二维码
  43. loadMake: true, // 组件加载完成后自动生成二维码
  44. shopId:0,
  45. headimg:'',
  46. username:'',
  47. distributorId:0,
  48. page: 1,
  49. pageSize: 20,
  50. loadingType:0
  51. }
  52. },
  53. onLoad(options) {
  54. this.shopId = options.shopId
  55. this.distributorId = options.distributorId
  56. this.headimg = options.headimg
  57. this.username = options.username
  58. this.getStoreProductList()
  59. },
  60. onReachBottom() {
  61. if(this.loadingType == 1){
  62. uni.stopPullDownRefresh()
  63. }else{
  64. this.page = this.page+1
  65. this.getStoreProductList()
  66. }
  67. },
  68. methods: {
  69. getStoreProductList() {
  70. // uni.showLoading({
  71. // mask: true,
  72. // title: '加载中...'
  73. // })
  74. NET.request(API.StoreProductList, {
  75. shopId: this.shopId,
  76. page:this.page,
  77. pageSize:this.pageSize
  78. }, 'GET').then(res => {
  79. uni.hideLoading()
  80. if(res.data.list.length == 0){
  81. this.loadingType = 1
  82. this.page = this.page
  83. }
  84. this.Productlist = this.Productlist.concat(res.data.list)
  85. }).catch(res => {
  86. uni.hideLoading()
  87. })
  88. },
  89. goodsDatails(item) {
  90. uni.navigateTo({
  91. url: '../goodsModule/goodsDetails?productId='+item.productId+'&shopId='+this.shopId+'&skuId='+item.skuId
  92. })
  93. },
  94. fenxiang(item) {
  95. // #ifdef APP-PLUS
  96. var system = 1
  97. // #endif
  98. // #ifdef H5
  99. var system = 3
  100. // #endif
  101. // #ifdef MP-WEIXIN
  102. var system = 2
  103. // #endif
  104. // #ifdef MP-ALIPAY
  105. var system = 4
  106. // #endif
  107. // uni.showLoading({
  108. // mask: true,
  109. // title: '请稍候...'
  110. // })
  111. NET.request(API.getSharePic, {
  112. productId: item.productId,
  113. shopId: item.shopId,
  114. skuId: item.skuId,
  115. terminal: system
  116. }, 'GET').then(res => {
  117. uni.hideLoading()
  118. // 推广商品
  119. uni.navigateTo({
  120. url: `../../pages_category_page1/distributionModule/shareProduct?shareType=2&shareImg=${res.data}&productId=${item.productId}&skuId=${item.skuId}&shopId=${item.shopId}&salesId=${this.distributorId}`
  121. });
  122. }).catch(res => {
  123. uni.hideLoading()
  124. })
  125. }
  126. }
  127. }
  128. </script>
  129. <style lang='scss' scoped>
  130. input {
  131. padding-left: 80upx;
  132. }
  133. .warp {
  134. display: flex;
  135. align-items: center;
  136. justify-content: center;
  137. height: 100%;
  138. }
  139. .qrimg-i {
  140. margin-right: 10px;
  141. }
  142. .rect {
  143. width: 89%;
  144. height: 80%;
  145. background-color: #fff;
  146. position: relative;
  147. .guanbi {
  148. width: 46rpx;
  149. height: 46rpx;
  150. position: absolute;
  151. top: -100rpx;
  152. left: 50%;
  153. margin-left: -23rpx;
  154. }
  155. .user {
  156. display: flex;
  157. padding: 20upx;
  158. }
  159. }
  160. .fenx {
  161. position: fixed;
  162. bottom: 0rpx;
  163. z-index: 10001;
  164. background-color: #F7F7F7;
  165. width: 100%;
  166. height: 98rpx;
  167. display: flex;
  168. color: #343434;
  169. view {
  170. line-height: 98rpx;
  171. }
  172. image {
  173. width: 50rpx;
  174. height: 50rpx;
  175. display: inline-block;
  176. margin-top: 25rpx;
  177. }
  178. }
  179. .fenxiang {
  180. height: 50upx;
  181. line-height: 50upx;
  182. width: 120upx;
  183. color: #FFEBC4;
  184. text-align: center;
  185. position: absolute;
  186. background-color: #333333;
  187. right: 10upx;
  188. }
  189. .container {
  190. .emptyCart-box {
  191. margin-top: 70upx;
  192. .emptyCart-img{
  193. width: 216rpx;
  194. height: 156rpx;
  195. }
  196. }
  197. .searchImg {
  198. width: 36upx;
  199. height: 36upx;
  200. position: absolute;
  201. left: 60upx;
  202. }
  203. .search-box {
  204. background-color: #F7F7F7;
  205. border-radius: 33upx;
  206. width: 530upx;
  207. height: 66upx;
  208. }
  209. .searchboxPlace {
  210. font-size: 26upx;
  211. color: #A9A9A9;
  212. padding-right: 30upx;
  213. }
  214. .searchClose-icon {
  215. width: 30upx;
  216. height: 30upx;
  217. margin-left: -50upx;
  218. }
  219. .promotion618 {
  220. width: 130upx;
  221. height: 30upx;
  222. }
  223. .goodsDetails-box {
  224. width: 690upx;
  225. .goodsDetails {
  226. position: relative;
  227. border-bottom: 1upx solid #EDEDED;
  228. padding-bottom: 30upx;
  229. .goodsName-box {
  230. width: 389upx;
  231. height: 85upx;
  232. .img618-cion {
  233. width: 70upx;
  234. height: 36upx;
  235. }
  236. }
  237. .goodsImg {
  238. width: 260upx;
  239. height: 260upx;
  240. }
  241. .discounts-box {
  242. margin-left: -10upx;
  243. margin-top: 20upx;
  244. .discounts-text {
  245. margin-left: 10upx;
  246. color: #C5AA7B;
  247. background-color: #FFE4CC;
  248. padding: 6upx 12upx;
  249. border-radius: 4upx;
  250. }
  251. }
  252. .arrowImg {
  253. width: 20upx;
  254. height: 20upx;
  255. }
  256. }
  257. }
  258. }
  259. </style>