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