order-sharelogin.vue 6.4 KB

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