purchase-chain-products.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <template>
  2. <view class="purchase-chain-products-container">
  3. <view v-if="!isShowUpgrade" :style="{ paddingBottom: selectGoods.productId ? '200upx' : '10upx' }">
  4. <view style="padding: 0 0 100upx;background: linear-gradient(164deg, #FFC3C3 8%, #FFF5E5 50%, #FFFFFF 78%);">
  5. <JHeader title="会员升级大礼包" width="50" height="50" style="padding: 24upx 0 0;color: #222229;">
  6. <template #ftFn>
  7. <text style="padding-right: 18upx;">规则</text>
  8. </template>
  9. </JHeader>
  10. <view style="margin-top: 40upx;text-align: center;">
  11. <image
  12. src="../../../static/images/user/activity/user-upgrade-package.png"
  13. style="width: 686upx;height: 330upx;border-radius: 20upx;box-shadow: 0 56upx 30upx -30upx rgba(243, 95, 48, 0.6);"
  14. >
  15. </image>
  16. </view>
  17. </view>
  18. <view style="padding: 0 28upx;">
  19. <view style="font-size: 36upx;font-weight: bold;">超值权益多选一</view>
  20. <view style="display: flex;align-items: center;margin-top: 20upx;">
  21. <view style="font-size: 34upx;font-weight: bold;">所在区域:</view>
  22. <JArea :text="manageAreaName" style="flex: 1;" @confirm="handleSelectArea"></JArea>
  23. </view>
  24. <!-- 商品列表 -->
  25. <view
  26. v-if="goodsList && goodsList.length"
  27. style="display: flex;justify-content: space-between;flex-wrap: wrap;width: 100%;margin-top: 32upx;"
  28. >
  29. <view v-for="(item, index) in goodsList" :key="index" style="width: 47%;">
  30. <view
  31. style="position: relative;padding: 4upx;border-radius: 30upx;overflow: hidden;"
  32. :style="{ backgroundImage: selectGoods.productId === item.productId ? 'linear-gradient(180deg, #FFD5AB 0%, #F52E29 100%)' : 'linear-gradient(212deg, #F3F0F0 4%, #FCDBDB 96%)' }"
  33. >
  34. <view
  35. style="position: absolute;top: 0;left: 0;z-index: 1;width: 110upx;padding: 10upx 16upx;font-size: 30upx;color: #ffffff;text-align: center;background: linear-gradient(270deg, #EE6C33 0%, #F52E29 98%);border-radius: 30upx 0 30upx 0;"
  36. >
  37. <text>权益 {{ index + 1 }}</text>
  38. </view>
  39. <view
  40. style="padding: 80upx 0 24upx;background: linear-gradient(212deg, #F3F0F0 4%, #FCDBDB 96%);border-radius: 26upx;overflow: hidden;"
  41. >
  42. <view style="padding-left: 14upx;">
  43. <view style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;font-weight: bold;">
  44. {{
  45. item.productName }}
  46. </view>
  47. <view style="margin-top: 10upx;;color: #824100;">
  48. <text style="font-size: 26upx;">价值: ¥</text>
  49. <text style="font-size: 28upx;font-weight: bold;">{{ item.price }}</text>
  50. </view>
  51. </view>
  52. <view style="margin-top: 20upx;;text-align: center;">
  53. <image :src="common.seamingImgUrl(item.image)" style="width: 276upx;height: 168upx;border-radius: 20upx;"></image>
  54. </view>
  55. </view>
  56. </view>
  57. <view style="text-align: center;">
  58. <tui-button
  59. v-if="selectGoods.productId === item.productId" type="warning" width="276rpx" height="64upx"
  60. shape="circle" margin="20upx 0"
  61. style="display: inline-block;background: linear-gradient(90deg, #F52F29 0%, #EF6532 100%)!important;"
  62. @click="selectGoods = item"
  63. >
  64. 已选择
  65. </tui-button>
  66. <tui-button
  67. v-else type="black" width="276rpx" height="64upx"
  68. shape="circle" margin="20upx 0" plain
  69. style="display: inline-block;" @click="selectGoods = item"
  70. >
  71. 点击选择
  72. </tui-button>
  73. </view>
  74. </view>
  75. </view>
  76. <view v-else>
  77. <tui-no-data :fixed="false" style="margin-top: 100upx;">{{ queryInfo.manageArea ? '暂无商品' : '暂无数据,请先选择区域' }}</tui-no-data>
  78. </view>
  79. </view>
  80. <view
  81. v-if="selectGoods.productId"
  82. style="position: fixed;bottom: 0;z-index: 2;padding: 18upx 0;text-align: center;background-color: #ffffff;"
  83. >
  84. <view style="font-size: 24upx;color: #222229;">
  85. <tui-icon name="about" :size="24" unit="upx" color="#444444"></tui-icon>
  86. 会员套餐同个账号仅可享受一次超值权益
  87. </view>
  88. <view style="padding: 20upx 0 18upx;text-align: center;">
  89. <tui-button
  90. type="warning" width="680rpx" height="104upx" margin="0 20upx 0"
  91. style="display: inline-block;background: linear-gradient(90deg, #F52E29 0%, #FA5151 45%, #FF8F1F 97%)!important;border-radius: 16upx;box-shadow: 0px 2px 2px 0px #FA6842,0px 5px 20px 0px rgba(250, 104, 66, 0.8);"
  92. @click="go(`/another-tf/another-serve/goodsDetails/index?shopId=${selectGoods.shopId}&productId=${selectGoods.productId}&skuId=${selectGoods.skuId}`)"
  93. >
  94. <text style="font-size: 34upx;font-weight: bold;">
  95. <text>立即购买</text>
  96. <text v-if="selectGoods.price" style="color: #FFDD90;">¥{{ selectGoods.price || '--' }}</text>
  97. </text>
  98. </tui-button>
  99. </view>
  100. <view style="font-size: 24upx;">
  101. <text style="color: #AEAEAE;">开通会员即表示同意:</text>
  102. <text style="color: #222229;">升级协议</text>
  103. <text style="padding: 0 14upx;color: #AEAEAE;">|</text>
  104. <text style="color: #222229;">会员协议</text>
  105. </view>
  106. </view>
  107. </view>
  108. <view v-else>
  109. <tui-landscape
  110. show :position="1" mask mask-closable
  111. :icon-size="28" icon-color="#FFFFFF"
  112. @close="handleCloseLandscape"
  113. >
  114. <view @click="go('/another-tf/another-user/user-upgrade/user-upgrade-application')">
  115. <image src="../../../static/images/user/activity/upgrade-regimental-commander.png" mode="widthFix" style="width: 500upx;max-height: 75vh;" />
  116. </view>
  117. </tui-landscape>
  118. </view>
  119. </view>
  120. </template>
  121. <script>
  122. import { getSelectProductPlatformRelationApi, getSelectLevelPlatformRelationApi } from '../../../api/anotherTFInterface'
  123. export default {
  124. name: 'PurchaseChainProducts',
  125. onLoad(options) {
  126. getSelectLevelPlatformRelationApi({})
  127. .then((res) => {
  128. if (res.data && res.data.levelType === 1) {
  129. this.isShowUpgrade = false
  130. this.getGoodsList()
  131. } else if (res.data && res.data.levelType === 2) {
  132. this.isShowUpgrade = true
  133. } else if (res.data && (res.data.levelType === 3 || res.data.levelType === 4)) {
  134. this.isShowUpgrade = false
  135. this.getGoodsList()
  136. this.$showToast('您已成为团长')
  137. } else if (res.data && res.data.levelType === 5) {
  138. this.isShowUpgrade = false
  139. this.getGoodsList()
  140. this.$showToast('您已成为合伙人')
  141. } else {
  142. this.isShowUpgrade = false
  143. this.getGoodsList()
  144. }
  145. })
  146. },
  147. data() {
  148. return {
  149. isShowUpgrade: false,
  150. selectGoods: {},
  151. goodsList: [],
  152. manageAreaName: '广东省佛山市顺德区',
  153. queryInfo: {
  154. manageArea: '440606' // 顺德区
  155. }
  156. }
  157. },
  158. methods: {
  159. getGoodsList() {
  160. if (!this.queryInfo.manageArea) this.$showToast('请先选择区域')
  161. uni.showLoading()
  162. getSelectProductPlatformRelationApi(this.queryInfo)
  163. .then((res) => {
  164. this.goodsList = res.data
  165. uni.hideLoading()
  166. })
  167. .catch((e) => {
  168. uni.hideLoading()
  169. })
  170. },
  171. handleSelectArea(e) {
  172. this.manageAreaName = e.area
  173. this.queryInfo.manageArea = e.county.id || e.city.id || e.province.id
  174. this.getGoodsList()
  175. },
  176. handleCloseLandscape() {
  177. uni.navigateBack()
  178. }
  179. }
  180. }
  181. </script>
  182. <style lang="less" scoped>
  183. .purchase-chain-products-container {
  184. width: 100%;
  185. min-height: 100vh;
  186. box-sizing: border-box;
  187. }
  188. </style>