selectService.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  1. <!-- 选择服务页面 -->
  2. <template>
  3. <view class="select_service">
  4. <view class="order_goods">
  5. <view class="goods_list">
  6. <view class="goods_pre" @click="goProductDetail(orderProduct.productId,orderProduct.goodsId)">
  7. <view class="goods_image">
  8. <image :src="orderProduct.productImage" mode="aspectFit"></image>
  9. </view>
  10. <view class="goods_des">
  11. <view class="goods_name">{{orderProduct.goodsName}}</view>
  12. <view class="goods_spec" v-if="orderProduct.specValues">{{orderProduct.specValues}}</view>
  13. </view>
  14. </view>
  15. </view>
  16. </view>
  17. <!-- 服务方式 start -->
  18. <view class="uni-list service_list">
  19. <radio-group @change="radioChange">
  20. <label class="service_pre" v-for="(item,index) in servicelList" :key="index" @click="goApplyRefund(item.value)">
  21. <view class="service_pre_left">
  22. <view class="service_des">
  23. <view class="service_des_top">
  24. <text class="service_pre_tip"></text>
  25. <text class="service_pre_title">{{item.title}}</text>
  26. </view>
  27. <view class="servece_pre_content">{{item.content}}</view>
  28. </view>
  29. </view>
  30. <image :src="imgUrl+'goods_detail/right_down.png'" mode="" class="service_right"></image>
  31. </label>
  32. </radio-group>
  33. </view>
  34. <!-- 服务方式 end -->
  35. </view>
  36. </template>
  37. <script>
  38. import {
  39. mapState
  40. } from 'vuex';
  41. import recommendGoods from "@/components/recommend-goods.vue";
  42. import uniPopup from '@/components/uni-popup/uni-popup.vue';
  43. import uniPopupMessage from '@/components/uni-popup/uni-popup-message.vue';
  44. import uniPopupDialog from '@/components/uni-popup/uni-popup-dialog.vue';
  45. let startY = 0,
  46. moveY = 0,
  47. pageAtTop = true;
  48. export default {
  49. components: {
  50. recommendGoods,
  51. uniPopup,
  52. uniPopupMessage,
  53. uniPopupDialog
  54. },
  55. data() {
  56. return {
  57. imgUrl: getApp().globalData.imgUrl,
  58. coverTransform: 'translateY(0px)',
  59. coverTransition: '0s',
  60. moving: false,
  61. afsSn:'', //退款单号
  62. allData:{}, //订单详细信息
  63. orderProduct:{}, //订单商品列表
  64. current:'0', //选择服务当前点击的是第0项
  65. servicelList:[
  66. {
  67. title:'仅退款(无需退货)',
  68. content:'没收到货,或与卖家协商同意不用退货仅退款',
  69. value:'0'
  70. },{
  71. title:'退货退款',
  72. content:'已收到货,需要退还收到的货物',
  73. value:'1'
  74. }
  75. // ,{
  76. // title:'换货',
  77. // content:'商品存在质量问题,联系卖家协商换货',
  78. // value:'2'
  79. // },
  80. ],
  81. orderSn:'', //订单号
  82. orderProductId:'', //订单中商品列表中商品的id
  83. orderOrder:{}, //订单信息
  84. orderListLen:1, //同订单,订单length
  85. }
  86. },
  87. async onLoad(option) {
  88. //退款单号
  89. this.afsSn = option.afsSn;
  90. this.orderSn = option.orderSn;
  91. this.orderProductId = option.orderProductId;
  92. this.initData();
  93. this.getOrderDetail();
  94. this.orderListLen = option.orderListLen;
  95. },
  96. // #ifndef MP
  97. onNavigationBarButtonTap(e) {
  98. const index = e.index;
  99. if (index === 0) {
  100. this.navTo('/pages/set/set');
  101. } else if (index === 1) {
  102. // #ifdef APP-PLUS
  103. const pages = getCurrentPages();
  104. const page = pages[pages.length - 1];
  105. const currentWebview = page.$getAppWebview();
  106. currentWebview.hideTitleNViewButtonRedDot({
  107. index
  108. });
  109. // #endif
  110. uni.navigateTo({
  111. url: '/pages/notice/notice'
  112. })
  113. }
  114. },
  115. // #endif
  116. computed: {
  117. ...mapState(['hasLogin', 'userInfo', 'userCenterData'])
  118. },
  119. methods: {
  120. initData() {
  121. },
  122. /**
  123. * 统一跳转接口,拦截未登录路由
  124. * navigator标签现在默认没有转场动画,所以用view
  125. */
  126. navTo(url) {
  127. if (!this.hasLogin) {
  128. url = '/pages/public/login';
  129. }
  130. uni.navigateTo({
  131. url
  132. })
  133. },
  134. /**
  135. * 会员卡下拉和回弹
  136. * 1.关闭bounce避免ios端下拉冲突
  137. * 2.由于touchmove事件的缺陷(以前做小程序就遇到,比如20跳到40,h5反而好很多),下拉的时候会有掉帧的感觉
  138. * transition设置0.1秒延迟,让css来过渡这段空窗期
  139. * 3.回弹效果可修改曲线值来调整效果,推荐一个好用的bezier生成工具 http://cubic-bezier.com/
  140. */
  141. coverTouchstart(e) {
  142. if (pageAtTop === false) {
  143. return;
  144. }
  145. this.coverTransition = 'transform .1s linear';
  146. startY = e.touches[0].clientY;
  147. },
  148. coverTouchmove(e) {
  149. moveY = e.touches[0].clientY;
  150. let moveDistance = moveY - startY;
  151. if (moveDistance < 0) {
  152. this.moving = false;
  153. return;
  154. }
  155. this.moving = true;
  156. if (moveDistance >= 80 && moveDistance < 100) {
  157. moveDistance = 80;
  158. }
  159. if (moveDistance > 0 && moveDistance <= 80) {
  160. this.coverTransform = `translateY(${moveDistance}px)`;
  161. }
  162. },
  163. coverTouchend() {
  164. if (this.moving === false) {
  165. return;
  166. }
  167. this.moving = false;
  168. this.coverTransition = 'transform 0.3s cubic-bezier(.21,1.93,.53,.64)';
  169. this.coverTransform = 'translateY(0px)';
  170. },
  171. //获取订单详情信息 申请退换货
  172. getOrderDetail(){
  173. let that = this;
  174. let param = {};
  175. param.url = 'v3/business/front/after/sale/apply/applyInfo';
  176. param.method = 'GET';
  177. param.data = {};
  178. param.data.orderSn = that.orderSn;
  179. param.data.orderProductId = that.orderProductId;
  180. that.$request(param).then(res => {
  181. if (res.state == 200) {
  182. let result = res.data;
  183. that.orderProduct = result.orderProduct;
  184. that.orderOrder = result.order;
  185. that.allData = result || {};
  186. that.loadFlag = true;
  187. } else {
  188. this.$api.msg(res.msg);
  189. }
  190. }).catch((e) => {
  191. //异常处理
  192. })
  193. },
  194. //去申请退款页面
  195. goApplyRefund(value){
  196. let that = this;
  197. this.servicelList.map((item,index)=>{
  198. if(item.value == value){
  199. this.current = index;
  200. }
  201. })
  202. uni.navigateTo({
  203. url:'/pages/order/applyRefund?serviceType='+that.current +'&orderProductId=' + that.orderProduct.orderProductId +'&afsSn=' + that.orderProduct.afsSn + '&sourceType=selecTService' + '&orderListLen=' + that.orderListLen
  204. })
  205. },
  206. //去商品详情页
  207. goProductDetail(productId,goodsId){
  208. uni.navigateTo({
  209. url: '/pages/product/detail?productId=' + productId + '&goodsId='+goodsId
  210. })
  211. }
  212. }
  213. }
  214. </script>
  215. <style lang='scss'>
  216. page {
  217. background: $bg-color-split;
  218. }
  219. .select_service{
  220. width: 750rpx;
  221. margin: 0 auto;
  222. background: #F5F5F5;
  223. .order_goods{
  224. border-top: 20rpx solid #F5F5F5;
  225. background-color: #FFFFFF;
  226. .goods_list{
  227. padding: 20rpx 0;
  228. .goods_pre{
  229. display: flex;
  230. padding: 0 20rpx;
  231. box-sizing: border-box;
  232. .goods_image{
  233. width: 200rpx;
  234. height: 200rpx;
  235. background: #F3F3F3;
  236. border-radius: 14px;
  237. image{
  238. width: 200rpx;
  239. height: 200rpx;
  240. border-radius: 14rpx;
  241. }
  242. }
  243. .goods_des{
  244. margin-left: 25rpx;
  245. padding-top: 8rpx;
  246. box-sizing: border-box;
  247. .goods_name{
  248. width: 340rpx;
  249. font-size: 28rpx;
  250. font-family: PingFang SC;
  251. font-weight: 500;
  252. color: #343434;
  253. line-height: 39rpx;
  254. text-overflow: -o-ellipsis-lastline;
  255. overflow: hidden;
  256. text-overflow: ellipsis;
  257. display: -webkit-box;
  258. -webkit-line-clamp: 2;
  259. line-clamp: 2;
  260. -webkit-box-orient: vertical;
  261. }
  262. .goods_spec{
  263. font-size: 24rpx;
  264. font-family: PingFang SC;
  265. font-weight: 400;
  266. color: #949494;
  267. line-height: 30rpx;
  268. margin-top: 20rpx;
  269. }
  270. }
  271. }
  272. }
  273. }
  274. .service_list{
  275. background-color: #FFFFFF;
  276. border-top: 20rpx solid #F5F5F5;
  277. .service_pre{
  278. height: 120rpx;
  279. display: flex;
  280. align-items: center;
  281. margin-left: 20rpx;
  282. box-sizing: border-box;
  283. justify-content: space-between;
  284. border-bottom: 1rpx solid #EEEEEE;
  285. .service_pre_left{
  286. display: flex;
  287. align-items: center;
  288. .service_des{
  289. display: flex;
  290. flex-direction: column;
  291. .service_des_top{
  292. display: flex;
  293. align-items: center;
  294. .service_pre_tip{
  295. background: #FF0000;
  296. width: 10rpx;
  297. border-radius: 50%;
  298. height: 10rpx;
  299. margin-right: 20rpx;
  300. }
  301. .service_pre_title{
  302. font-size: 28rpx;
  303. font-family: PingFang SC;
  304. font-weight: 500;
  305. color: #343434;
  306. line-height: 45rpx;
  307. }
  308. }
  309. .servece_pre_content{
  310. font-size: 24rpx;
  311. font-family: PingFang SC;
  312. font-weight: 500;
  313. color: #9A9A9A;
  314. line-height: 45rpx;
  315. padding-left: 30rpx;
  316. }
  317. }
  318. }
  319. .service_right{
  320. width: 46rpx;
  321. height: 46rpx;
  322. }
  323. }
  324. }
  325. }
  326. </style>