loginshare.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <template>
  2. <view class="container login" v-if="isShareStatus">
  3. <view class="container-main clearfix">
  4. <view class="main-title">此订单包含如下商品:</view>
  5. <view class="main-list clearfix">
  6. <view class="main-list-item" v-for="(item, index) in productList" :key="index">
  7. <view class="item-image">
  8. <image :src="item.mainImage" mode="widthFix"></image>
  9. </view>
  10. <view class="item-mesage">
  11. <view class="item-name">{{item.name}}</view>
  12. <view class="item-num"><text>X</text>{{item.num}}</view>
  13. </view>
  14. </view>
  15. </view>
  16. </view>
  17. <view class="container-footer">
  18. <view class="login-btn" @click.stop="goLogin(1)">账号登录查看</view>
  19. <view class="login-btn" @click.stop="goLogin(2)">使用分享码查看</view>
  20. <view class="pay-statustext">
  21. <view class="pay-statustext-inner">
  22. <view class="pay-icon">
  23. <text class="iconfont icon-gantanhao-yuankuang"></text>
  24. </view>
  25. <view class="pay-text">
  26. <text>使用账号登录支持确认订单和直接付款,使用分享码只支持查看订单,不能操作</text>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. import authorize from '@/common/config/authorize.js'
  35. import { orderShareCode } from "@/api/order.js"
  36. export default{
  37. data() {
  38. return{
  39. imagePath:'https://img.caimei365.com/group1/M00/03/83/Cmis214FbbCAQhKoAAKWfqqSIds292.png',
  40. shareCode:'', //获取用户登录的邀请码
  41. isUserInfo:false, //控制显示授权弹窗
  42. nickName:'', //存储用户名
  43. userInfo:'', //存储微信用户授权信息
  44. orderID:0, //订单ID
  45. userID:0, //分享人的用户ID
  46. isShareStatus:false,
  47. serviceProviderId:'',
  48. productList:[
  49. {mainImage:'https://img.caimei365.com/group1/M00/03/95/Cmis2F778GGALIeNAAGtOmuO4Sk263.jpg',name:'元泰Picocare皮秒激光美容仪皮秒激光调Q激光色素治疗养肤换肤祛除彩色纹身',num:1},
  50. {mainImage:'https://img.caimei365.com/group1/M00/03/95/Cmis2F778GGALIeNAAGtOmuO4Sk263.jpg',name:'元泰Picocare皮秒激光美容仪皮秒激光调Q激光色素治疗养肤换肤祛除彩色纹身',num:1},
  51. {mainImage:'https://img.caimei365.com/group1/M00/03/95/Cmis2F778GGALIeNAAGtOmuO4Sk263.jpg',name:'元泰Picocare皮秒激光美容仪皮秒激光调Q激光色素治疗养肤换肤祛除彩色纹身',num:1},
  52. {mainImage:'https://img.caimei365.com/group1/M00/03/95/Cmis2F778GGALIeNAAGtOmuO4Sk263.jpg',name:'元泰Picocare皮秒激光美容仪皮秒激光调Q激光色素治疗养肤换肤祛除彩色纹身',num:1},
  53. {mainImage:'https://img.caimei365.com/group1/M00/03/95/Cmis2F778GGALIeNAAGtOmuO4Sk263.jpg',name:'元泰Picocare皮秒激光美容仪皮秒激光调Q激光色素治疗养肤换肤祛除彩色纹身',num:1},
  54. {mainImage:'https://img.caimei365.com/group1/M00/03/95/Cmis2F778GGALIeNAAGtOmuO4Sk263.jpg',name:'元泰Picocare皮秒激光美容仪皮秒激光调Q激光色素治疗养肤换肤祛除彩色纹身',num:1},
  55. {mainImage:'https://img.caimei365.com/group1/M00/03/95/Cmis2F778GGALIeNAAGtOmuO4Sk263.jpg',name:'元泰Picocare皮秒激光美容仪皮秒激光调Q激光色素治疗养肤换肤祛除彩色纹身',num:1},
  56. {mainImage:'https://img.caimei365.com/group1/M00/03/95/Cmis2F778GGALIeNAAGtOmuO4Sk263.jpg',name:'元泰Picocare皮秒激光美容仪皮秒激光调Q激光色素治疗养肤换肤祛除彩色纹身',num:1},
  57. {mainImage:'https://img.caimei365.com/group1/M00/03/95/Cmis2F778GGALIeNAAGtOmuO4Sk263.jpg',name:'元泰Picocare皮秒激光美容仪皮秒激光调Q激光色素治疗养肤换肤祛除彩色纹身',num:1},
  58. {mainImage:'https://img.caimei365.com/group1/M00/03/95/Cmis2F778GGALIeNAAGtOmuO4Sk263.jpg',name:'元泰Picocare皮秒激光美容仪皮秒激光调Q激光色素治疗养肤换肤祛除彩色纹身',num:1},
  59. {mainImage:'https://img.caimei365.com/group1/M00/03/95/Cmis2F778GGALIeNAAGtOmuO4Sk263.jpg',name:'元泰Picocare皮秒激光美容仪皮秒激光调Q激光色素治疗养肤换肤祛除彩色纹身',num:1},
  60. {mainImage:'https://img.caimei365.com/group1/M00/03/95/Cmis2F778GGALIeNAAGtOmuO4Sk263.jpg',name:'元泰Picocare皮秒激光美容仪皮秒激光调Q激光色素治疗养肤换肤祛除彩色纹身',num:1},
  61. ]
  62. }
  63. },
  64. onLoad(e) {
  65. console.log(e)
  66. this.orderID = e.orderID
  67. this.userID = e.userID
  68. if(e.serviceProviderId){
  69. this.serviceProviderId = e.serviceProviderId
  70. }
  71. },
  72. methods:{
  73. initQueryUser(){
  74. authorize.getCode('weixin').then(wechatcode =>{
  75. let params ={
  76. code:wechatcode,
  77. orderID:this.orderID,
  78. userID:this.userID,
  79. shareCode:this.shareCode,
  80. serviceProviderId:this.serviceProviderId
  81. }
  82. orderShareCode(params).then(response =>{
  83. console.log(response.code)
  84. if(response.code === 2){
  85. this.$api.navigateTo(`/seller/pages/order/order-details?type=share&orderID=${this.orderID}`)
  86. }else if(response.code === 0) {
  87. console.log(response.data)
  88. if(response.data == true){//同为会所运营人员查看订单详情
  89. this.$api.navigateTo(`/pages/user/order/order-details?type=share&orderID=${this.orderID}`)
  90. }else{//游客第二次查看订单详情
  91. this.$api.redirectTo(`/pages/user/order/order-sharedetails?orderID=${this.orderID}`)
  92. }
  93. }else if(response.code === -2){
  94. this.$util.modal('提示',response.msg,'确定','',false,() =>{})
  95. }else{
  96. this.isShareStatus = true
  97. }
  98. })
  99. })
  100. },
  101. goLogin(index){
  102. switch(index){
  103. case 1:
  104. this.$store.commit('setLoginType',7)
  105. this.$store.commit('setLoginOrderId',this.orderID)
  106. this.$api.navigateTo('/pages/login/login')
  107. break;
  108. case 2:
  109. this.$api.navigateTo(`/pages/user/order/orderShareLogin?orderID=${this.orderID}&userID=${this.userID}`)
  110. break;
  111. }
  112. }
  113. },
  114. onShow() {
  115. this.initQueryUser()
  116. }
  117. }
  118. </script>
  119. <style lang="scss">
  120. .login{
  121. width: 100%;
  122. height:auto;
  123. background: #F7F7F7;
  124. .model-warp.none{
  125. display: none;
  126. }
  127. .model-warp.show{
  128. display: block;
  129. }
  130. .container-main{
  131. width: 100%;
  132. height: auto;
  133. padding-top:80rpx ;
  134. padding-bottom: 352rpx;
  135. .main-title{
  136. width: 100%;
  137. height: 80rpx;
  138. padding: 0 20rpx;
  139. background-color: #F7F7F7;
  140. line-height: 80rpx;
  141. text-align: left;
  142. font-size: $font-size-30;
  143. color: #333;
  144. box-sizing: border-box;
  145. position: fixed;
  146. top: 0;
  147. left: 0;
  148. }
  149. .main-list{
  150. box-sizing: border-box;
  151. width: 100%;
  152. height: auto;
  153. background-color: #FFFFFF;
  154. .main-list-item{
  155. box-sizing: border-box;
  156. width: 100%;
  157. height: 200rpx;
  158. padding: 20rpx;
  159. border-bottom: 1px solid #F7F7F7;
  160. .item-image{
  161. width: 160rpx;
  162. height: 160rpx;
  163. float: left;
  164. image{
  165. width: 160rpx;
  166. height: 160rpx;
  167. display: block;
  168. }
  169. }
  170. .item-mesage{
  171. width: 530rpx;
  172. height: 160rpx;
  173. float: left;
  174. margin-left: 20rpx;
  175. .item-name{
  176. width: 100%;
  177. height:84rpx;
  178. line-height: 42rpx;
  179. font-size: $font-size-28;
  180. color: #333333;
  181. text-align: justify;
  182. text-overflow:ellipsis;
  183. display: -webkit-box;
  184. word-break: break-all;
  185. -webkit-box-orient: vertical;
  186. -webkit-line-clamp: 2;
  187. overflow: hidden;
  188. }
  189. .item-num{
  190. width: 100%;
  191. height:46rpx;
  192. line-height: 46rpx;
  193. margin-top: 30rpx;
  194. font-size: $font-size-28;
  195. color: #333333;
  196. text-align: left;
  197. text{
  198. font-size: $font-size-20;
  199. }
  200. }
  201. }
  202. }
  203. }
  204. }
  205. .login-btn{
  206. width: 702rpx;
  207. height: 88rpx;
  208. font-size: $font-size-28;
  209. line-height: 88rpx;
  210. color: #FFFFFF;
  211. margin: 0 auto;
  212. margin-bottom: 24rpx;
  213. text-align: center;
  214. background: $btn-confirm;
  215. border-radius: 14rpx;
  216. }
  217. .container-footer{
  218. box-sizing: border-box;
  219. width: 100%;
  220. height: 352rpx;
  221. padding: 0 24rpx;
  222. padding-top: 24rpx;
  223. padding-bottom: 24rpx;
  224. background-color: #FFFFFF;
  225. position: fixed;
  226. bottom: 0;
  227. left: 0;
  228. }
  229. .pay-statustext{
  230. width: 100%;
  231. height: auto;
  232. float: left;
  233. .pay-statustext-inner{
  234. width: 100%;
  235. margin: 0 auto;
  236. .pay-icon{
  237. width: 62rpx;
  238. height: 100%;
  239. float: left;
  240. text-align: center;
  241. .iconfont{
  242. color: $color-system;
  243. font-size:$font-size-36;
  244. line-height: 20rpx;
  245. }
  246. }
  247. .pay-text{
  248. width: 635rpx;
  249. height: 100%;
  250. float: left;
  251. line-height: 40rpx;
  252. font-size: $font-size-26;
  253. color: $color-system;
  254. text-align: justify;
  255. }
  256. }
  257. }
  258. }
  259. </style>