敢为人鲜小程序前端代码仓库
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.

352 lines
6.6 KiB

1 week 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. </uv-popup>
  72. </view>
  73. </template>
  74. <script>
  75. export default {
  76. onLoad(option) {
  77. this.titleIndex = option.index
  78. },
  79. components: {
  80. },
  81. data() {
  82. return {
  83. titleIndex: 0,
  84. title: ['申请换货', '申请退货'],
  85. fileList: [],
  86. bottomBtnStyle: {
  87. color: '#FFF',
  88. backgroundColor: '#fd5100',
  89. fontSize: '34rpx',
  90. text: '提交申请',
  91. width: '400rpx',
  92. height: '80rpx',
  93. borderRadius: '100rpx',
  94. bottom: '40rpx'
  95. },
  96. commodityList: [{
  97. title: '商品名称',
  98. smallTitle: '产品规格:120*4*75【桌子尺寸】',
  99. total: 1,
  100. },
  101. {
  102. title: '商品名称1',
  103. smallTitle: '产品规格:120*4*75【桌子尺寸】',
  104. total: 1,
  105. },
  106. {
  107. title: '商品名称2',
  108. smallTitle: '产品规格:120*4*75【桌子尺寸】',
  109. total: 1,
  110. }
  111. ],
  112. commodity: {
  113. title: '商品名称',
  114. smallTitle: '产品规格:120*4*75【桌子尺寸】',
  115. total: 1,
  116. },
  117. }
  118. },
  119. mounted() {
  120. },
  121. methods: {
  122. openSpPopup() {
  123. this.$refs.spPopup.open('bottom');
  124. },
  125. // 选择退换货商品回调
  126. selectCommodity(e) {
  127. console.log(e, "selectCommodity--e")
  128. this.commodity = e
  129. this.$refs.spPopup.close()
  130. },
  131. confirm() {
  132. console.log("===");
  133. },
  134. deleteImage(e) {
  135. this.fileList.splice(e.index, 1)
  136. },
  137. afterRead(e) {
  138. let self = this
  139. e.file.forEach(file => {
  140. self.$Oss.ossUpload(file.url).then(url => {
  141. self.fileList.push({
  142. url
  143. })
  144. })
  145. })
  146. },
  147. }
  148. }
  149. </script>
  150. <style lang="scss" scoped>
  151. * {
  152. box-sizing: border-box;
  153. }
  154. .refundsOrExchange {
  155. .frame {
  156. display: flex;
  157. flex-direction: column;
  158. gap: 30rpx;
  159. width: 100%;
  160. padding-top: 40rpx;
  161. background-color: #f5f5f5;
  162. .itme1 {
  163. display: flex;
  164. height: 200rpx;
  165. background-color: #ffffff;
  166. .left {
  167. padding: 40rpx;
  168. width: 20%;
  169. border-radius: 10rpx;
  170. background-color: #ffffff;
  171. }
  172. .center {
  173. display: flex;
  174. flex-direction: column;
  175. justify-content: center;
  176. gap: 20rpx;
  177. width: 60%;
  178. padding: 0rpx 0 0 20rpx;
  179. background-color: #ffffff;
  180. // 给第一个 view 设置样式
  181. >view:first-of-type {
  182. font-size: 36rpx;
  183. color: #333;
  184. }
  185. // 给第二个 view 设置样式
  186. >view:nth-of-type(2) {
  187. font-size: 28rpx;
  188. color: #666666;
  189. }
  190. }
  191. .right {
  192. display: flex;
  193. justify-content: center;
  194. align-items: center;
  195. width: 10%;
  196. color: #666666;
  197. background-color: #ffffff;
  198. }
  199. }
  200. .item2 {
  201. width: 100vw;
  202. .type {
  203. display: flex;
  204. align-items: center;
  205. background-color: #FFF;
  206. height: 80rpx;
  207. padding: 0 0 0 20rpx;
  208. >span:nth-of-type(1) {
  209. width: 30%;
  210. }
  211. >span:nth-of-type(2) {
  212. width: 70%;
  213. }
  214. }
  215. .reason {
  216. display: flex;
  217. align-items: center;
  218. background-color: #FFF;
  219. height: 80rpx;
  220. // margin: 10rpx 0 0 0;
  221. padding: 10rpx 0 0 20rpx;
  222. >view:nth-of-type(1) {
  223. width: 30%;
  224. }
  225. >view:nth-of-type(2) {
  226. width: 70%;
  227. padding: 0 20rpx 0 0;
  228. }
  229. }
  230. }
  231. .item3 {
  232. width: 100vw;
  233. .type {
  234. display: flex;
  235. align-items: center;
  236. background-color: #FFF;
  237. height: 80rpx;
  238. padding: 0 0 0 20rpx;
  239. >span:nth-of-type(1) {
  240. width: 70%;
  241. }
  242. >span:nth-of-type(2) {
  243. width: 30%;
  244. }
  245. }
  246. .reason {
  247. display: flex;
  248. align-items: center;
  249. background-color: #FFF;
  250. height: 80rpx;
  251. // margin: 10rpx 0 0 0;
  252. padding: 10rpx 0 0 20rpx;
  253. >view:nth-of-type(1) {
  254. width: 30%;
  255. }
  256. >view:nth-of-type(2) {
  257. width: 70%;
  258. padding: 0 20rpx 0 0;
  259. }
  260. }
  261. }
  262. .item4 {
  263. display: flex;
  264. flex-direction: column;
  265. padding: 10rpx 0 0 20rpx;
  266. background-color: #FFF;
  267. >view:nth-of-type(1) {
  268. background-color: #FFF;
  269. }
  270. >view:nth-of-type(2) {
  271. margin: 10rpx 0 10rpx 0;
  272. background-color: #FFF;
  273. }
  274. }
  275. .item5 {
  276. display: flex;
  277. flex-direction: column;
  278. padding: 0 0 0 20rpx;
  279. background-color: #FFF;
  280. .phone {
  281. display: flex;
  282. align-items: center;
  283. background-color: #FFF;
  284. height: 80rpx;
  285. // margin: 10rpx 0 0 0;
  286. padding: 10rpx 0 0 20rpx;
  287. >view:nth-of-type(1) {
  288. width: 30%;
  289. }
  290. >view:nth-of-type(2) {
  291. width: 70%;
  292. padding: 0 20rpx 0 0;
  293. }
  294. }
  295. }
  296. }
  297. }
  298. </style>