order-sharelogin.vue 6.3 KB

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