酒店桌布为微信小程序
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.

389 lines
8.2 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 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>商品规格:{{ commodity.sku }}</view>
  13. <view>下单时间:{{ commodity.startTime }}</view>
  14. </view>
  15. <view class="right">×{{ 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="item2">
  23. <view class="type">
  24. <span>申请类型</span>
  25. <span>{{ titleIndex == 0?'退货退款':'换货'}}</span>
  26. </view>
  27. <uv-line></uv-line>
  28. <view class="reason">
  29. <view>申请原因</view>
  30. <view>
  31. <uv-input v-model="form.reason" placeholder="请输入申请原因" border="none" clearable></uv-input>
  32. </view>
  33. </view>
  34. </view>
  35. <!-- 退货数量&申请金额-->
  36. <view class="item3">
  37. <view class="type">
  38. <span>{{ titleIndex == 0 ? '退货数量' : '换货数量' }}</span>
  39. <span>
  40. <uv-number-box v-model="form.refundNum" :min="1" :max="commodity.num"></uv-number-box>
  41. </span>
  42. </view>
  43. <uv-line v-if='titleIndex == 0 ? true :false'></uv-line>
  44. <view class="reason" v-if='titleIndex == 0 ? true :false'>
  45. <view>申请金额</view>
  46. <view>
  47. <uv-input v-model="form.reasonPrice" disabled border="none" clearable></uv-input>
  48. </view>
  49. </view>
  50. </view>
  51. <!-- 申请说明 -->
  52. <view class="item4">
  53. <view>申请说明(选填)</view>
  54. <view>
  55. <uv-input v-model="form.reasonInfo" placeholder="请您详细填写申请说明" border="none" clearable></uv-input>
  56. </view>
  57. <view>
  58. <uv-upload :fileList="fileList" :maxCount="5" multiple width="150rpx" height="150rpx"
  59. @delete="deleteImage" @afterRead="afterRead" :previewFullImage="true"></uv-upload>
  60. </view>
  61. </view>
  62. <!-- 联系电话 -->
  63. <view class="item5">
  64. <view class="phone">
  65. <view>联系电话</view>
  66. <view>
  67. <uv-input v-model="form.phone" placeholder="请输入联系电话" border="none" clearable></uv-input>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. <!-- 底部按钮 -->
  73. <bottomBtn @confirm='confirm()' :color='bottomBtnStyle.color' :backgroundColor='bottomBtnStyle.backgroundColor'
  74. :fontSize='bottomBtnStyle.fontSize' :text='bottomBtnStyle.text' :width="bottomBtnStyle.width"
  75. :height="bottomBtnStyle.height" :borderRadius='bottomBtnStyle.borderRadius' :bottom='bottomBtnStyle.bottom'>
  76. </bottomBtn>
  77. <!--商品选择-->
  78. <uv-popup ref="spPopup" :round="30">
  79. <commoditySelect height="60vh" @selectSp="selectCommodity" ref="commoditySelect" />
  80. </uv-popup>
  81. </view>
  82. </template>
  83. <script>
  84. import bottomBtn from "../../components/bottom/bottomBtn.vue"
  85. import commoditySelect from "../components/commodity/commoditySelect.vue"
  86. export default {
  87. onLoad(option) {
  88. this.titleIndex = option.index
  89. },
  90. components: {
  91. bottomBtn,
  92. commoditySelect
  93. },
  94. data() {
  95. return {
  96. titleIndex: 0,
  97. title: ['申请退货', '申请换货'],
  98. fileList: [],
  99. bottomBtnStyle: {
  100. color: '#FFF',
  101. backgroundColor: '#fd5100',
  102. fontSize: '34rpx',
  103. text: '提交申请',
  104. width: '400rpx',
  105. height: '80rpx',
  106. borderRadius: '100rpx',
  107. bottom: '40rpx'
  108. },
  109. commodity: {
  110. goodsName: '',
  111. sku: '',
  112. num: 0,
  113. startTime: '',
  114. goodsPic: '',
  115. },
  116. form: {
  117. id: "",
  118. phone: "",
  119. reason: "",
  120. reasonInfo: "",
  121. reasonPic: "",
  122. reasonPrice: "",
  123. refundNum: "",
  124. type: '', //0退货 1换货
  125. },
  126. }
  127. },
  128. onShow() {
  129. this.$refs.commoditySelect.getList()
  130. },
  131. methods: {
  132. openSpPopup() {
  133. this.$refs.spPopup.open('bottom');
  134. },
  135. // 选择退换货商品回调
  136. selectCommodity(e) {
  137. console.log(e, "selectCommodity--e")
  138. console.log(e.id, 'e.id');
  139. this.form.id = e.id //设置租赁ID
  140. this.form.reasonPrice = e.price //设置退款金额(押金)
  141. this.form.refundNum = e.num //设置数量
  142. this.commodity = e
  143. this.$refs.spPopup.close()
  144. },
  145. //确认退换货
  146. confirm() {
  147. this.form.type = this.titleIndex
  148. this.form.reasonPic = this.fileList.map(item=>item.url).join(",")
  149. console.log(this.form, "form");
  150. this.$api('refundOrder', this.form, res => {
  151. if (res.code == 200) {
  152. uni.showToast({
  153. icon: "success",
  154. title: "申请成功"
  155. })
  156. setTimeout(() => {
  157. uni.navigateTo({
  158. url: '/pages/index/center'
  159. })
  160. }, 3000)
  161. }
  162. })
  163. },
  164. deleteImage(e) {
  165. this.fileList.splice(e.index, 1)
  166. },
  167. afterRead(e) {
  168. let self = this
  169. e.file.forEach(file => {
  170. self.$Oss.ossUpload(file.url).then(url => {
  171. self.fileList.push({
  172. url
  173. })
  174. })
  175. })
  176. },
  177. }
  178. }
  179. </script>
  180. <style lang="scss" scoped>
  181. * {
  182. box-sizing: border-box;
  183. }
  184. .refundsOrExchange {
  185. .frame {
  186. display: flex;
  187. flex-direction: column;
  188. gap: 30rpx;
  189. // width: 100%;
  190. padding: 40rpx 40rpx 0 40rpx;
  191. background-color: #f5f5f5;
  192. .itme1 {
  193. display: flex;
  194. height: 200rpx;
  195. background-color: #ffffff;
  196. .left {
  197. padding: 20rpx;
  198. width: 150rpx;
  199. height: 150rpx;
  200. border-radius: 20rpx;
  201. background-color: #ffffff;
  202. flex-shrink: 0;
  203. image {
  204. width: 100%;
  205. height: 100%;
  206. border-radius: 20rpx;
  207. }
  208. }
  209. .center {
  210. display: flex;
  211. flex-direction: column;
  212. justify-content: center;
  213. gap: 20rpx;
  214. width: 60%;
  215. padding: 0rpx 0 0 20rpx;
  216. background-color: #ffffff;
  217. // 给第一个 view 设置样式
  218. >view:first-of-type {
  219. font-size: 36rpx;
  220. color: #333;
  221. }
  222. // 给第二个 view 设置样式
  223. >view:nth-of-type(2) {
  224. font-size: 28rpx;
  225. color: #666666;
  226. }
  227. // 给第三个 view 设置样式
  228. >view:nth-of-type(3) {
  229. font-size: 28rpx;
  230. color: #666666;
  231. }
  232. }
  233. .right {
  234. display: flex;
  235. justify-content: center;
  236. align-items: center;
  237. width: 10%;
  238. color: #666666;
  239. background-color: #ffffff;
  240. }
  241. }
  242. .item2 {
  243. // width: 100vw;
  244. .type {
  245. display: flex;
  246. align-items: center;
  247. background-color: #FFF;
  248. height: 80rpx;
  249. padding: 0 0 0 20rpx;
  250. >span:nth-of-type(1) {
  251. width: 30%;
  252. }
  253. >span:nth-of-type(2) {
  254. width: 70%;
  255. }
  256. }
  257. .reason {
  258. display: flex;
  259. align-items: center;
  260. background-color: #FFF;
  261. height: 80rpx;
  262. // margin: 10rpx 0 0 0;
  263. padding: 10rpx 0 0 20rpx;
  264. >view:nth-of-type(1) {
  265. width: 30%;
  266. }
  267. >view:nth-of-type(2) {
  268. width: 70%;
  269. padding: 0 20rpx 0 0;
  270. }
  271. }
  272. }
  273. .item3 {
  274. // width: 100vw;
  275. .type {
  276. display: flex;
  277. align-items: center;
  278. background-color: #FFF;
  279. height: 80rpx;
  280. padding: 0 0 0 20rpx;
  281. >span:nth-of-type(1) {
  282. width: 70%;
  283. }
  284. >span:nth-of-type(2) {
  285. width: 30%;
  286. }
  287. }
  288. .reason {
  289. display: flex;
  290. align-items: center;
  291. background-color: #FFF;
  292. height: 80rpx;
  293. // margin: 10rpx 0 0 0;
  294. padding: 10rpx 0 0 20rpx;
  295. >view:nth-of-type(1) {
  296. width: 30%;
  297. }
  298. >view:nth-of-type(2) {
  299. width: 70%;
  300. padding: 0 20rpx 0 0;
  301. }
  302. }
  303. }
  304. .item4 {
  305. display: flex;
  306. flex-direction: column;
  307. padding: 10rpx 0 0 20rpx;
  308. background-color: #FFF;
  309. >view:nth-of-type(1) {
  310. background-color: #FFF;
  311. }
  312. >view:nth-of-type(2) {
  313. margin: 10rpx 0 10rpx 0;
  314. background-color: #FFF;
  315. }
  316. }
  317. .item5 {
  318. display: flex;
  319. flex-direction: column;
  320. padding: 0 0 0 20rpx;
  321. background-color: #FFF;
  322. .phone {
  323. display: flex;
  324. align-items: center;
  325. background-color: #FFF;
  326. height: 80rpx;
  327. // margin: 10rpx 0 0 0;
  328. padding: 10rpx 0 0 20rpx;
  329. >view:nth-of-type(1) {
  330. width: 30%;
  331. }
  332. >view:nth-of-type(2) {
  333. width: 70%;
  334. padding: 0 20rpx 0 0;
  335. }
  336. }
  337. }
  338. }
  339. }
  340. </style>