order-sharelogin.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  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}&userId=${this.params.userId}`)
  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. })
  82. },
  83. getOrderCommodityData(){//查询订单商品信息s
  84. this.OrderService.OrderCommodityData({orderId:this.params.orderId}).then(response =>{
  85. this.productList = response.data
  86. this.isShareStatus = true
  87. }).catch(error =>{
  88. this.$util.msg(error.msg,2000)
  89. })
  90. },
  91. goLogin(index){
  92. switch(index){
  93. case 1:
  94. this.$store.commit('setLoginType',7)
  95. this.$store.commit('setLoginOrderId',this.params.orderId)
  96. this.$api.navigateTo('/pages/login/login')
  97. break
  98. case 2:
  99. this.$api.navigateTo(`/pages/user/order/orderShareLogin?orderId=${this.params.orderId}&userId=${this.params.userId}`)
  100. break
  101. }
  102. }
  103. },
  104. onShow() {
  105. }
  106. }
  107. </script>
  108. <style lang="scss">
  109. .login{
  110. width: 100%;
  111. height:100%;
  112. background: #F7F7F7;
  113. .model-warp.none{
  114. display: none;
  115. }
  116. .model-warp.show{
  117. display: block;
  118. }
  119. .container-main{
  120. width: 100%;
  121. height: auto;
  122. padding-top:80rpx ;
  123. padding-bottom: 352rpx;
  124. .main-title{
  125. width: 100%;
  126. height: 80rpx;
  127. padding: 0 20rpx;
  128. background-color: #F7F7F7;
  129. line-height: 80rpx;
  130. text-align: left;
  131. font-size: $font-size-30;
  132. color: #333;
  133. box-sizing: border-box;
  134. position: fixed;
  135. top: 0;
  136. left: 0;
  137. }
  138. .main-list{
  139. box-sizing: border-box;
  140. width: 100%;
  141. height: auto;
  142. background-color: #FFFFFF;
  143. .main-list-item{
  144. box-sizing: border-box;
  145. width: 100%;
  146. height: 200rpx;
  147. padding: 20rpx;
  148. border-bottom: 1px solid #F7F7F7;
  149. .item-image{
  150. width: 160rpx;
  151. height: 160rpx;
  152. float: left;
  153. image{
  154. width: 160rpx;
  155. height: 160rpx;
  156. display: block;
  157. }
  158. }
  159. .item-mesage{
  160. width: 530rpx;
  161. height: 160rpx;
  162. float: left;
  163. margin-left: 20rpx;
  164. .item-name{
  165. width: 100%;
  166. height:84rpx;
  167. line-height: 42rpx;
  168. font-size: $font-size-28;
  169. color: #333333;
  170. text-align: justify;
  171. text-overflow:ellipsis;
  172. display: -webkit-box;
  173. word-break: break-all;
  174. -webkit-box-orient: vertical;
  175. -webkit-line-clamp: 2;
  176. overflow: hidden;
  177. }
  178. .item-num{
  179. width: 100%;
  180. height:46rpx;
  181. line-height: 46rpx;
  182. margin-top: 30rpx;
  183. font-size: $font-size-28;
  184. color: #333333;
  185. text-align: left;
  186. text{
  187. font-size: $font-size-20;
  188. }
  189. }
  190. }
  191. }
  192. }
  193. }
  194. .login-btn{
  195. width: 600rpx;
  196. height: 88rpx;
  197. font-size: $font-size-28;
  198. line-height: 88rpx;
  199. color: #FFFFFF;
  200. margin: 0 auto;
  201. margin-bottom: 24rpx;
  202. text-align: center;
  203. background: $btn-confirm;
  204. border-radius: 50rpx;
  205. }
  206. .container-footer{
  207. box-sizing: border-box;
  208. width: 100%;
  209. height: 352rpx;
  210. padding: 0 24rpx;
  211. padding-top: 24rpx;
  212. padding-bottom: 24rpx;
  213. background-color: #FFFFFF;
  214. position: fixed;
  215. bottom: 0;
  216. left: 0;
  217. }
  218. .pay-statustext{
  219. width: 100%;
  220. height: auto;
  221. float: left;
  222. .pay-statustext-inner{
  223. width: 100%;
  224. margin: 0 auto;
  225. .pay-icon{
  226. width: 62rpx;
  227. height: 100%;
  228. float: left;
  229. text-align: center;
  230. .iconfont{
  231. color: $color-system;
  232. font-size:$font-size-36;
  233. line-height: 20rpx;
  234. }
  235. }
  236. .pay-text{
  237. width: 635rpx;
  238. height: 100%;
  239. float: left;
  240. line-height: 40rpx;
  241. font-size: $font-size-26;
  242. color: $color-system;
  243. text-align: justify;
  244. }
  245. }
  246. }
  247. }
  248. </style>