order-sharelogin.vue 7.2 KB

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