index.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <template>
  2. <view>
  3. <view class='password-window' :class='window==true?"on":""' :style="{ 'background-image': `url(${domain}/static/images/passwordPop.png)`}">
  4. <view class='passwordCount'>
  5. <view class="title1 acea-row row-between-wrapper">
  6. <image v-if="userInfo.avatar" :src="userInfo.avatar" class="picture"></image>
  7. <text class="name line1">{{userInfo.nickname}}</text>
  8. 给你分享了宝贝
  9. </view>
  10. <view class="banner">
  11. <image :src="storeInfo.image"></image>
  12. </view>
  13. <view class="pro-info">
  14. <view class="price acea-row">¥<text class="money">{{storeInfo.price}}</text>
  15. <text v-if="storeInfo.product_type == 0" class="pro_type">普通商品</text>
  16. </view>
  17. <view class="name line1">{{storeInfo.store_name}}</view>
  18. </view>
  19. <button v-if="storeInfo.product_type != 3" class="go_btn" @click="goDetail(storeInfo)">查看详情</button>
  20. <button v-if="storeInfo.product_type == 3" class="go_btn btn1" @click="goDetail(storeInfo)">帮他助力</button>
  21. </view>
  22. <view class='lid'>
  23. <view class='iconfont icon-guanbi3' @click="close"></view>
  24. </view>
  25. </view>
  26. <view class='mask' catchtouchmove="true" :hidden="window==false" style="z-index: 999;"></view>
  27. </view>
  28. </template>
  29. <script>
  30. // +----------------------------------------------------------------------
  31. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  32. // +----------------------------------------------------------------------
  33. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  34. // +----------------------------------------------------------------------
  35. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  36. // +----------------------------------------------------------------------
  37. // | Author: CRMEB Team <admin@crmeb.com>
  38. // +----------------------------------------------------------------------
  39. import { pwdResolution } from '@/api/user.js'
  40. import { mapGetters } from "vuex";
  41. import {toLogin} from '@/libs/login.js';
  42. import { goShopDetail } from '@/libs/order.js'
  43. import {initiateAssistApi} from '@/api/activity.js';
  44. import {HTTP_REQUEST_URL} from '@/config/app.js';
  45. export default {
  46. props: {
  47. isLogin:{
  48. type: Boolean,
  49. default: false
  50. }
  51. },
  52. data() {
  53. return {
  54. window: false,
  55. couponList: [],
  56. userInfo: {},
  57. storeInfo: {},
  58. pwdInfo: {},
  59. domain: HTTP_REQUEST_URL,
  60. };
  61. },
  62. computed: mapGetters(["copyPwd", "uid"]),
  63. watch: {
  64. copyPwd:{
  65. handler(nVal,oVal){
  66. if(nVal)this.resolution(nVal)
  67. },
  68. immediate: true,
  69. deep:true
  70. }
  71. },
  72. mounted(){
  73. },
  74. beforeDestroy(){
  75. },
  76. methods: {
  77. close:function(){
  78. this.window = false
  79. },
  80. resolution(data){
  81. let com = uni.getStorageSync('pwdKey')
  82. pwdResolution(data).then(res => {
  83. if(res.data.user && res.data.user.uid != this.uid && com !=res.data.com){
  84. this.window = true;
  85. this.pwdInfo = res.data;
  86. this.userInfo = res.data.user;
  87. this.storeInfo = res.data.data;
  88. if(res.data.activity_id )this.storeInfo.activity_id = res.data.activity_id
  89. if(res.data.product_type )this.storeInfo.product_type = res.data.product_type
  90. this.$store.commit("PARSE_PWD", null)
  91. uni.setStorageSync('pwdKey', res.data.com);
  92. }
  93. })
  94. },
  95. goDetail(item){
  96. goShopDetail(item, this.uid).then(res => {
  97. this.$store.commit("PARSE_PWD", null)
  98. if (this.isLogin) {
  99. initiateAssistApi(item.activity_id).then(res => {
  100. let id = res.data.product_assist_set_id;
  101. uni.hideLoading();
  102. uni.navigateTo({
  103. url: '/pages/activity/assist_detail/index?id=' + id
  104. });
  105. }).catch((err) => {
  106. uni.showToast({
  107. title: err,
  108. icon: 'none'
  109. })
  110. });
  111. } else {
  112. toLogin();
  113. }
  114. })
  115. }
  116. }
  117. }
  118. </script>
  119. <style scoped lang="scss">
  120. .password-window {
  121. background-repeat: no-repeat;
  122. background-size: 100% 100%;
  123. background-color: #fff;
  124. width: 580rpx;
  125. height: 910rpx;
  126. position: fixed;
  127. top: 50%;
  128. z-index: 1000;
  129. left: 50%;
  130. margin-left: -290rpx;
  131. margin-top: -455rpx;
  132. transform: translate3d(0, -200%, 0);
  133. transition: all .3s cubic-bezier(.25, .5, .5, .9);
  134. border-radius: 24rpx;
  135. padding: 25rpx 30rpx 40rpx;
  136. }
  137. .password-window.on {
  138. transform: translate3d(0, 0, 0);
  139. }
  140. .passwordCount .title1{
  141. width: 380rpx;
  142. margin: 0 auto;
  143. height: 42rpx;
  144. background: #F1F1F1;
  145. border-radius: 23rpx;
  146. padding: 0 15rpx;
  147. color: #666666;
  148. font-size: 24rpx;
  149. .picture{
  150. width: 36rpx;
  151. height: 36rpx;
  152. border-radius: 100%;
  153. image{
  154. width: 36rpx;
  155. height: 36rpx;
  156. }
  157. }
  158. .name{
  159. color: #282828;
  160. font-weight: bold;
  161. max-width: 100rpx;
  162. margin: 0 10rpx;
  163. }
  164. }
  165. .password-window .banner{
  166. width: 520rpx;
  167. height: 520rpx;
  168. margin-top: 25rpx;
  169. image{
  170. width: 520rpx;
  171. height: 520rpx;
  172. border-radius: 16rpx;
  173. }
  174. }
  175. .password-window .pro-info{
  176. margin-top: 15rpx;
  177. .price{
  178. color: #E93323;
  179. font-size: 26rpx;
  180. justify-content: left;
  181. align-items: center;
  182. .money{
  183. font-size: 42rpx;
  184. }
  185. }
  186. .pro_type{
  187. display: inline-block;
  188. width: 100rpx;
  189. height: 28rpx;
  190. text-align: center;
  191. line-height: 28rpx;
  192. background: #FDEAE8;
  193. margin-left: 30rpx;
  194. font-size: 18rpx;
  195. position: relative;
  196. &::before{
  197. content: "";
  198. display: inline-block;
  199. width: 0;
  200. height: 0;
  201. border-width: 15rpx 15rpx 15rpx 0;
  202. border-style: solid;
  203. border-color: transparent #FDEAE8 transparent transparent;
  204. position: absolute;
  205. left: -16rpx;
  206. }
  207. &::after{
  208. content: "";
  209. display: inline-block;
  210. width: 6rpx;
  211. height: 6rpx;
  212. background: #fff;
  213. border-radius: 100%;
  214. position: absolute;
  215. top: 12.5rpx;
  216. left: -4rpx;
  217. z-index: 10;
  218. }
  219. }
  220. .name{
  221. margin-top: 15rpx;
  222. color: #282828;
  223. font-size: 30rpx;
  224. }
  225. }
  226. .password-window .lid {
  227. position: absolute;
  228. bottom: -100rpx;
  229. left: 0;
  230. width: 100%;
  231. text-align: center;
  232. }
  233. .go_btn{
  234. margin-top: 50rpx;
  235. width: 520rpx;
  236. height: 80rpx;
  237. line-height: 80rpx;
  238. text-align: center;
  239. background: #E93323;
  240. color: #ffffff;
  241. border-radius: 40rpx;
  242. font-size: 28rpx;
  243. &.btn1{
  244. background: #FC8327
  245. }
  246. }
  247. .password-window .lid .iconfont {
  248. color: #fff;
  249. font-size: 60rpx;
  250. text-align: center;
  251. margin-left: -30rpx;
  252. }
  253. </style>