酒店桌布为微信小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

465 lines
10 KiB

7 months ago
7 months ago
7 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
7 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
6 months ago
7 months ago
7 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
7 months ago
7 months ago
6 months ago
7 months ago
7 months ago
6 months ago
7 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
6 months ago
7 months ago
7 months ago
5 months ago
7 months ago
7 months ago
5 months ago
7 months ago
7 months ago
7 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
  1. <template>
  2. <view class="refundsOrExchange">
  3. <navbar :title="title[titleIndex]" leftClick @leftClick="$utils.navigateBack" />
  4. <view class="frame">
  5. <!-- 商品简介 -->
  6. <view class="itme1" @click="openSpPopup">
  7. <view class="left">
  8. <image :src="commodity.goodsPic" mode="aspectFill" />
  9. </view>
  10. <view class="center">
  11. <view>{{ commodity.goodsName }}</view>
  12. <view v-if="commodity.sku">商品规格:{{ commodity.sku }}</view>
  13. <view v-if="commodity.createTime">下单时间:{{ $dayjs(commodity.createTime).format('YYYY-MM-DD') }}</view>
  14. </view>
  15. <view class="right" v-if="commodity.num">×{{ commodity.num }}</view>
  16. </view>
  17. <!-- 暂未选择商品的时候 -->
  18. <!-- <view v-else style="height: 200rpx;;display: flex;justify-content: center;align-items: center;font-size: 36px;">
  19. 请选择商品...
  20. </view> -->
  21. <!-- 地址 -->
  22. <view class="address" @click="openAddress">
  23. <image src="/static/image/address/selectIcon.png" mode=""></image>
  24. <view class="">
  25. {{ address.name }}
  26. </view>
  27. <view class="">
  28. {{ address.addressDetail }}
  29. </view>
  30. <view class="icon">
  31. <uv-icon size="30rpx" name="arrow-right"></uv-icon>
  32. </view>
  33. </view>
  34. <!-- 申请类型&申请原因 -->
  35. <view class="item2">
  36. <view class="type">
  37. <span>申请类型</span>
  38. <span>{{ titleIndex == 0?'退货退款':'换货'}}</span>
  39. </view>
  40. <uv-line></uv-line>
  41. <view class="reason">
  42. <view>申请原因</view>
  43. <view>
  44. <uv-input v-model="form.reason" placeholder="请输入申请原因" border="none" clearable></uv-input>
  45. </view>
  46. </view>
  47. </view>
  48. <!-- 退货数量&申请金额-->
  49. <view class="item3">
  50. <view class="type">
  51. <span>{{ titleIndex == 0 ? '退货数量' : '换货数量' }}</span>
  52. <span>
  53. <uv-number-box v-model="form.refundNum" :min="1" :max="commodity.num"></uv-number-box>
  54. </span>
  55. </view>
  56. <uv-line v-if='titleIndex == 0 ? true :false'></uv-line>
  57. <view class="reason" v-if='titleIndex == 0 ? true :false'>
  58. <view>申请金额</view>
  59. <view>
  60. <uv-input v-model="form.reasonPrice" disabled border="none" clearable></uv-input>
  61. </view>
  62. </view>
  63. </view>
  64. <!-- 申请说明 -->
  65. <view class="item4">
  66. <view>申请说明(选填)</view>
  67. <view>
  68. <uv-input v-model="form.reasonInfo" placeholder="请您详细填写申请说明" border="none" clearable></uv-input>
  69. </view>
  70. <view>
  71. <uv-upload :fileList="fileList" :maxCount="5" multiple width="150rpx" height="150rpx"
  72. @delete="deleteImage" @afterRead="afterRead" :previewFullImage="true"></uv-upload>
  73. </view>
  74. </view>
  75. <!-- 联系电话 -->
  76. <!-- <view class="item5">
  77. <view class="phone">
  78. <view>联系电话</view>
  79. <view>
  80. <uv-input v-model="form.phone" placeholder="请输入联系电话" border="none" clearable></uv-input>
  81. </view>
  82. </view>
  83. </view> -->
  84. </view>
  85. <!-- 底部按钮 -->
  86. <bottomBtn @confirm='confirm()' :color='bottomBtnStyle.color' :backgroundColor='bottomBtnStyle.backgroundColor'
  87. :fontSize='bottomBtnStyle.fontSize' :text='bottomBtnStyle.text' :width="bottomBtnStyle.width"
  88. :height="bottomBtnStyle.height" :borderRadius='bottomBtnStyle.borderRadius' :bottom='bottomBtnStyle.bottom'>
  89. </bottomBtn>
  90. <!--商品选择-->
  91. <uv-popup ref="spPopup" :round="30">
  92. <commoditySelect height="60vh" leaseFlag="1" status="0" @selectSp="selectCommodity" ref="commoditySelect" />
  93. </uv-popup>
  94. <uv-popup ref="addressPopup" :round="30">
  95. <addressList ref="addressList" height="60vh" @select="selectAddress" />
  96. </uv-popup>
  97. </view>
  98. </template>
  99. <script>
  100. import bottomBtn from "../../components/bottom/bottomBtn.vue"
  101. import commoditySelect from "../components/commodity/commoditySelect.vue"
  102. import addressList from '@/components/address/addressList.vue'
  103. export default {
  104. onLoad(option) {
  105. this.titleIndex = option.index
  106. },
  107. components: {
  108. bottomBtn,
  109. addressList,
  110. commoditySelect
  111. },
  112. data() {
  113. return {
  114. titleIndex: 0,
  115. title: ['申请退货', '申请换货'],
  116. fileList: [],
  117. bottomBtnStyle: {
  118. color: '#FFF',
  119. backgroundColor: '#fd5100',
  120. fontSize: '34rpx',
  121. text: '提交申请',
  122. width: '400rpx',
  123. height: '80rpx',
  124. borderRadius: '100rpx',
  125. bottom: '40rpx'
  126. },
  127. commodity: {
  128. goodsName: '请选择租赁物品',
  129. sku: '',
  130. num: 0,
  131. startTime: '',
  132. goodsPic: '',
  133. },
  134. form: {
  135. id: "",
  136. phone: "",
  137. reason: "",
  138. reasonInfo: "",
  139. reasonPic: "",
  140. reasonPrice: "",
  141. refundNum: "",
  142. type: '', //0退货 1换货
  143. },
  144. addressTotal: 0,
  145. address: {
  146. name: '请选择联系人',
  147. addressDetail: '',
  148. },
  149. }
  150. },
  151. onShow() {
  152. this.$refs.commoditySelect.getList()
  153. // 获取地址列表
  154. this.$refs.addressList.getAddressList().then(res => {
  155. this.addressTotal = res.total
  156. if (this.addressTotal != 0) {
  157. this.address = res.records[0]
  158. }
  159. })
  160. },
  161. methods: {
  162. openSpPopup() {
  163. this.$refs.spPopup.open('bottom');
  164. },
  165. // 打开选择地址
  166. openAddress() {
  167. if (this.addressTotal == 0) {
  168. this.$refs.popup.close()
  169. return uni.navigateTo({
  170. url: '/pages_order/mine/address?type=back'
  171. })
  172. }
  173. this.$refs.addressPopup.open('bottom')
  174. },
  175. // 选择地址
  176. selectAddress(e) {
  177. this.address = e
  178. this.$refs.addressPopup.close()
  179. },
  180. // 选择退换货商品回调
  181. selectCommodity(e) {
  182. console.log(e, "selectCommodity--e")
  183. console.log(e.id, 'e.id');
  184. this.form.id = e.id //设置租赁ID
  185. this.form.reasonPrice = e.price //设置退款金额(押金)
  186. this.form.refundNum = e.num //设置数量
  187. this.commodity = e
  188. this.$refs.spPopup.close()
  189. },
  190. //确认退换货
  191. confirm() {
  192. this.form.type = this.titleIndex
  193. this.form.reasonPic = this.fileList.map(item=>item.url).join(",")
  194. this.form.addressId = this.address.id
  195. if (this.$utils.verificationAll(this.form, {
  196. id: '请选择租赁物品',
  197. reason: '请输入申请原因',
  198. addressId: '请选择地址',
  199. })) {
  200. return
  201. }
  202. this.$api('refundOrder', this.form, res => {
  203. if (res.code == 200) {
  204. uni.showToast({
  205. icon: "success",
  206. title: "申请成功"
  207. })
  208. setTimeout(uni.navigateBack, 1000, -1)
  209. }
  210. })
  211. },
  212. deleteImage(e) {
  213. this.fileList.splice(e.index, 1)
  214. },
  215. afterRead(e) {
  216. let self = this
  217. e.file.forEach(file => {
  218. self.$Oss.ossUpload(file.url).then(url => {
  219. console.log(url);
  220. self.fileList.push({
  221. url
  222. })
  223. })
  224. })
  225. },
  226. }
  227. }
  228. </script>
  229. <style lang="scss" scoped>
  230. * {
  231. box-sizing: border-box;
  232. }
  233. .refundsOrExchange {
  234. .address {
  235. display: flex;
  236. padding: 20rpx;
  237. background-color: #fff;
  238. image {
  239. width: 30rpx;
  240. height: 30rpx;
  241. margin: 20rpx;
  242. }
  243. view {
  244. margin: 20rpx;
  245. overflow: hidden; //超出的文本隐藏
  246. text-overflow: ellipsis; //溢出用省略号显示
  247. white-space: nowrap; //溢出不换行
  248. }
  249. .icon {
  250. margin-left: auto;
  251. }
  252. }
  253. .frame {
  254. display: flex;
  255. flex-direction: column;
  256. gap: 30rpx;
  257. // width: 100%;
  258. padding: 40rpx 40rpx 0 40rpx;
  259. background-color: #f5f5f5;
  260. .itme1 {
  261. display: flex;
  262. height: 200rpx;
  263. background-color: #ffffff;
  264. .left {
  265. padding: 20rpx;
  266. width: 150rpx;
  267. height: 150rpx;
  268. border-radius: 20rpx;
  269. background-color: #ffffff;
  270. flex-shrink: 0;
  271. image {
  272. width: 100%;
  273. height: 100%;
  274. border-radius: 20rpx;
  275. }
  276. }
  277. .center {
  278. display: flex;
  279. flex-direction: column;
  280. justify-content: center;
  281. gap: 20rpx;
  282. width: 60%;
  283. padding: 0rpx 0 0 20rpx;
  284. background-color: #ffffff;
  285. // 给第一个 view 设置样式
  286. >view:first-of-type {
  287. font-size: 36rpx;
  288. color: #333;
  289. }
  290. // 给第二个 view 设置样式
  291. >view:nth-of-type(2) {
  292. font-size: 28rpx;
  293. color: #666666;
  294. }
  295. // 给第三个 view 设置样式
  296. >view:nth-of-type(3) {
  297. font-size: 28rpx;
  298. color: #666666;
  299. }
  300. }
  301. .right {
  302. display: flex;
  303. justify-content: center;
  304. align-items: center;
  305. width: 10%;
  306. color: #666666;
  307. background-color: #ffffff;
  308. }
  309. }
  310. .item2 {
  311. // width: 100vw;
  312. .type {
  313. display: flex;
  314. align-items: center;
  315. background-color: #FFF;
  316. height: 80rpx;
  317. padding: 0 0 0 20rpx;
  318. >span:nth-of-type(1) {
  319. width: 30%;
  320. }
  321. >span:nth-of-type(2) {
  322. width: 70%;
  323. }
  324. }
  325. .reason {
  326. display: flex;
  327. align-items: center;
  328. background-color: #FFF;
  329. height: 80rpx;
  330. // margin: 10rpx 0 0 0;
  331. padding: 10rpx 0 0 20rpx;
  332. >view:nth-of-type(1) {
  333. width: 30%;
  334. }
  335. >view:nth-of-type(2) {
  336. width: 70%;
  337. padding: 0 20rpx 0 0;
  338. }
  339. }
  340. }
  341. .item3 {
  342. // width: 100vw;
  343. .type {
  344. display: flex;
  345. align-items: center;
  346. background-color: #FFF;
  347. height: 80rpx;
  348. padding: 0 0 0 20rpx;
  349. >span:nth-of-type(1) {
  350. width: 70%;
  351. }
  352. >span:nth-of-type(2) {
  353. width: 30%;
  354. }
  355. }
  356. .reason {
  357. display: flex;
  358. align-items: center;
  359. background-color: #FFF;
  360. height: 80rpx;
  361. // margin: 10rpx 0 0 0;
  362. padding: 10rpx 0 0 20rpx;
  363. >view:nth-of-type(1) {
  364. width: 30%;
  365. }
  366. >view:nth-of-type(2) {
  367. width: 70%;
  368. padding: 0 20rpx 0 0;
  369. }
  370. }
  371. }
  372. .item4 {
  373. display: flex;
  374. flex-direction: column;
  375. padding: 10rpx 0 0 20rpx;
  376. background-color: #FFF;
  377. >view:nth-of-type(1) {
  378. background-color: #FFF;
  379. }
  380. >view:nth-of-type(2) {
  381. margin: 10rpx 0 10rpx 0;
  382. background-color: #FFF;
  383. }
  384. }
  385. .item5 {
  386. display: flex;
  387. flex-direction: column;
  388. padding: 0 0 0 20rpx;
  389. background-color: #FFF;
  390. .phone {
  391. display: flex;
  392. align-items: center;
  393. background-color: #FFF;
  394. height: 80rpx;
  395. // margin: 10rpx 0 0 0;
  396. padding: 10rpx 0 0 20rpx;
  397. >view:nth-of-type(1) {
  398. width: 30%;
  399. }
  400. >view:nth-of-type(2) {
  401. width: 70%;
  402. padding: 0 20rpx 0 0;
  403. }
  404. }
  405. }
  406. }
  407. }
  408. </style>