商城类、订单类uniapp模板,多角色
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.

355 lines
6.8 KiB

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