order-sharelogin.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  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.image" mode="scaleToFill"></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. export default{
  36. data() {
  37. return{
  38. imagePath:'https://img.caimei365.com/group1/M00/03/83/Cmis214FbbCAQhKoAAKWfqqSIds292.png',
  39. shareCode:'', //获取用户登录的邀请码
  40. isUserInfo:false, //控制显示授权弹窗
  41. isShareStatus:false,
  42. productList:[],
  43. params:{
  44. code:'',
  45. iv:'',
  46. encryptedData:'',
  47. orderId:0, //订单ID
  48. userId:0, //机构用户ID
  49. serviceProviderId:0,//协销ID
  50. }
  51. }
  52. },
  53. onLoad(e) {
  54. console.log(e)
  55. this.params.orderId = e.orderId
  56. this.params.userId = e.userId
  57. if(e.serviceProviderId){
  58. this.params.serviceProviderId = e.serviceProviderId
  59. }
  60. this.initQueryUser()
  61. },
  62. methods:{
  63. async initQueryUser(){
  64. const getUserInfo = await authorize.getUserInfo('weixin')
  65. this.params.code = await authorize.getCode('weixin')
  66. this.params.iv = getUserInfo.iv
  67. this.params.encryptedData = getUserInfo.encryptedData
  68. this.OrderService.OrderShareCodeIdentity(this.params).then(response =>{
  69. if(response.code == 0){// 初始化订单商品数据
  70. console.log(response.msg)
  71. this.getOrderCommodityData()
  72. }else if(response.code == 1){// 同为会所运营人员查看订单详情
  73. this.$api.navigateTo(`/pages/user/order/order-details?type=share&orderId=${this.params.orderId}`)
  74. }else if(response.code == 2){// 协销查看分享订单
  75. this.$api.navigateTo(`/pages/seller/order/order-details?type=share&orderId=${this.params.orderId}`)
  76. }else if(response.code == 3){// 游客第二次查看订单详情
  77. this.$api.redirectTo(`/pages/user/order/order-sharedetails?orderId=${this.params.orderId}&userId=${this.params.userId}`)
  78. }else{// 错误信息返回
  79. this.$util.modal('提示',response.msg,'确定','',false,() =>{})
  80. }
  81. // if(response.code === 2){
  82. // this.$api.navigateTo(`/pages/seller/order/order-details?type=share&orderId=${this.params.orderId}`)
  83. // }else if(response.code === 0) {
  84. // console.log(response.data)
  85. // if(response.data == true){//同为会所运营人员查看订单详情
  86. // this.$api.navigateTo(`/pages/user/order/order-details?type=share&orderId=${this.params.orderId}`)
  87. // }else{//游客第二次查看订单详情
  88. // this.$api.redirectTo(`/pages/user/order/order-sharedetails?orderId=${this.params.orderId}&userId=${this.params.userId}`)
  89. // }
  90. // }else if(response.code === -2){
  91. // this.$util.modal('提示',response.msg,'确定','',false,() =>{})
  92. // }else{
  93. // console.log(response.msg)
  94. // this.getOrderCommodityData()
  95. // }
  96. })
  97. },
  98. getOrderCommodityData(){//查询订单商品信息s
  99. this.OrderService.OrderCommodityData({orderId:this.params.orderId}).then(response =>{
  100. this.productList = response.data
  101. this.isShareStatus = true
  102. }).catch(error =>{
  103. this.$util.msg(error.msg,2000)
  104. })
  105. },
  106. goLogin(index){
  107. switch(index){
  108. case 1:
  109. this.$store.commit('setLoginType',7)
  110. this.$store.commit('setLoginOrderId',this.params.orderId)
  111. this.$api.navigateTo('/pages/login/login')
  112. break
  113. case 2:
  114. this.$api.navigateTo(`/pages/user/order/orderShareLogin?orderId=${this.params.orderId}&userId=${this.params.userId}`)
  115. break
  116. }
  117. }
  118. },
  119. onShow() {
  120. }
  121. }
  122. </script>
  123. <style lang="scss">
  124. .login{
  125. width: 100%;
  126. height:100%;
  127. background: #F7F7F7;
  128. .model-warp.none{
  129. display: none;
  130. }
  131. .model-warp.show{
  132. display: block;
  133. }
  134. .container-main{
  135. width: 100%;
  136. height: auto;
  137. padding-top:80rpx ;
  138. padding-bottom: 352rpx;
  139. .main-title{
  140. width: 100%;
  141. height: 80rpx;
  142. padding: 0 20rpx;
  143. background-color: #F7F7F7;
  144. line-height: 80rpx;
  145. text-align: left;
  146. font-size: $font-size-30;
  147. color: #333;
  148. box-sizing: border-box;
  149. position: fixed;
  150. top: 0;
  151. left: 0;
  152. }
  153. .main-list{
  154. box-sizing: border-box;
  155. width: 100%;
  156. height: auto;
  157. background-color: #FFFFFF;
  158. .main-list-item{
  159. box-sizing: border-box;
  160. width: 100%;
  161. height: 200rpx;
  162. padding: 20rpx;
  163. border-bottom: 1px solid #F7F7F7;
  164. .item-image{
  165. width: 160rpx;
  166. height: 160rpx;
  167. float: left;
  168. image{
  169. width: 160rpx;
  170. height: 160rpx;
  171. display: block;
  172. }
  173. }
  174. .item-mesage{
  175. width: 530rpx;
  176. height: 160rpx;
  177. float: left;
  178. margin-left: 20rpx;
  179. .item-name{
  180. width: 100%;
  181. height:84rpx;
  182. line-height: 42rpx;
  183. font-size: $font-size-28;
  184. color: #333333;
  185. text-align: justify;
  186. text-overflow:ellipsis;
  187. display: -webkit-box;
  188. word-break: break-all;
  189. -webkit-box-orient: vertical;
  190. -webkit-line-clamp: 2;
  191. overflow: hidden;
  192. }
  193. .item-num{
  194. width: 100%;
  195. height:46rpx;
  196. line-height: 46rpx;
  197. margin-top: 30rpx;
  198. font-size: $font-size-28;
  199. color: #333333;
  200. text-align: left;
  201. text{
  202. font-size: $font-size-20;
  203. }
  204. }
  205. }
  206. }
  207. }
  208. }
  209. .login-btn{
  210. width: 600rpx;
  211. height: 88rpx;
  212. font-size: $font-size-28;
  213. line-height: 88rpx;
  214. color: #FFFFFF;
  215. margin: 0 auto;
  216. margin-bottom: 24rpx;
  217. text-align: center;
  218. background: $btn-confirm;
  219. border-radius: 50rpx;
  220. }
  221. .container-footer{
  222. box-sizing: border-box;
  223. width: 100%;
  224. height: 352rpx;
  225. padding: 0 24rpx;
  226. padding-top: 24rpx;
  227. padding-bottom: 24rpx;
  228. background-color: #FFFFFF;
  229. position: fixed;
  230. bottom: 0;
  231. left: 0;
  232. }
  233. .pay-statustext{
  234. width: 100%;
  235. height: auto;
  236. float: left;
  237. .pay-statustext-inner{
  238. width: 100%;
  239. margin: 0 auto;
  240. .pay-icon{
  241. width: 62rpx;
  242. height: 100%;
  243. float: left;
  244. text-align: center;
  245. .iconfont{
  246. color: $color-system;
  247. font-size:$font-size-36;
  248. line-height: 20rpx;
  249. }
  250. }
  251. .pay-text{
  252. width: 635rpx;
  253. height: 100%;
  254. float: left;
  255. line-height: 40rpx;
  256. font-size: $font-size-26;
  257. color: $color-system;
  258. text-align: justify;
  259. }
  260. }
  261. }
  262. }
  263. </style>