工单小程序2024-11-20
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.

359 lines
7.6 KiB

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