RedeemView.vue 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027
  1. <template>
  2. <div class="right-wrap">
  3. <el-breadcrumb separator="/" style="margin-bottom: 13px">
  4. <el-breadcrumb-item :to="{ path: '/home/pointsMall' }">积分商城</el-breadcrumb-item>
  5. <el-breadcrumb-item>兑换详情</el-breadcrumb-item>
  6. </el-breadcrumb>
  7. <el-card class="box-card">
  8. <div slot="header" class="clearfix">
  9. <span>兑换详情</span>
  10. <!-- <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button> -->
  11. </div>
  12. <div class="footer">
  13. <div class="left-info" style="width: 100%">
  14. <span class="info-title">
  15. <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"
  16. class="info-icon">
  17. <path fill-rule="evenodd" clip-rule="evenodd"
  18. d="M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1Z"
  19. fill="#165DFF"></path>
  20. <path fill-rule="evenodd" clip-rule="evenodd"
  21. d="M8.54189 6.70582C8.67075 6.70582 8.77522 6.81029 8.77522 6.93915L8.77511 10.2335L9.46743 10.2343C9.61176 10.2343 9.72876 10.3513 9.72876 10.4956V11.3319C9.72876 11.4762 9.61176 11.5932 9.46743 11.5932H6.58458C6.44025 11.5932 6.32324 11.4762 6.32324 11.3319V10.4956C6.32324 10.3513 6.44025 10.2343 6.58458 10.2343L7.28178 10.2335V8.08122L7.14759 8.08198C7.00326 8.08198 6.88626 7.96498 6.88626 7.82065V6.97073C6.88626 6.8264 7.00326 6.70939 7.14759 6.70939L7.47956 6.70859C7.49132 6.70677 7.50337 6.70582 7.51565 6.70582H8.54189ZM8.40513 4.41602C8.54946 4.41602 8.66646 4.53302 8.66646 4.67735V5.64802C8.66646 5.79235 8.54946 5.90935 8.40513 5.90935H7.43446C7.29013 5.90935 7.17313 5.79235 7.17313 5.64802V4.67735C7.17313 4.53302 7.29013 4.41602 7.43446 4.41602H8.40513Z"
  22. fill="white"></path>
  23. </svg>
  24. 物品介绍
  25. </span>
  26. <div v-html="data.comment"></div>
  27. </div>
  28. </div>
  29. <div v-show="deliveryType == 1">
  30. <p class="label">收货地址</p>
  31. <div class="address">
  32. <div v-if="addressDetail">
  33. <div class="address-container">
  34. <div class="header">
  35. <div class="left">
  36. <span>{{ name }}</span>
  37. </div>
  38. <span @click="handleClickAddress" role="button" class="btn">修改</span>
  39. </div>
  40. <p class="phone">{{ phone }}</p>
  41. <p class="address">{{ addressStr + street + address }}</p>
  42. </div>
  43. </div>
  44. <div v-else @click="handleClickAddress">
  45. <div class="address-container new">
  46. <i class="add-icon byte-icon byte-icon--plus"><svg xmlns="http://www.w3.org/2000/svg"
  47. viewBox="0 0 48 48">
  48. <path fill="none" d="M0 0h48v48H0z"></path>
  49. <path
  50. d="M24.7 4c.4 0 .6 0 .8.1.2.1.3.2.4.4.1.2.1.3.1.8V22h16.7c.4 0 .6 0 .8.1.2.1.3.2.4.4.1.2.1.3.1.8v1.4c0 .4 0 .6-.1.8-.1.2-.2.3-.4.4-.2.1-.3.1-.8.1H26v16.7c0 .4 0 .6-.1.8-.1.2-.2.3-.4.4-.2.1-.3.1-.8.1h-1.4c-.4 0-.6 0-.8-.1-.2-.1-.3-.2-.4-.4-.1-.2-.1-.3-.1-.8V26H5.3c-.4 0-.6 0-.8-.1-.2-.1-.3-.2-.4-.4-.1-.2-.1-.3-.1-.8v-1.4c0-.4 0-.6.1-.8.1-.2.2-.3.4-.4.2-.1.3-.1.8-.1H22V5.3c0-.4 0-.6.1-.8.1-.2.2-.3.4-.4.2-.1.3-.1.8-.1h1.4z">
  51. </path>
  52. </svg></i>
  53. <span class="add-label">添加收货地址</span>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. <div v-show="deliveryType == 4">
  59. <p class="label">手机直充</p>
  60. <div class="address">
  61. <div v-if="phoneNumber">
  62. <div class="address-container" style="min-height: 45px">
  63. <div class="header">
  64. <div class="left">
  65. <span>{{ phoneNumber }}</span>
  66. </div>
  67. <span @click="handleClickPhoneNumber" role="button" class="btn">修改</span>
  68. </div>
  69. </div>
  70. </div>
  71. <div v-else @click="handleClickPhoneNumber">
  72. <div class="address-container new">
  73. <i class="add-icon byte-icon byte-icon--plus"><svg xmlns="http://www.w3.org/2000/svg"
  74. viewBox="0 0 48 48">
  75. <path fill="none" d="M0 0h48v48H0z"></path>
  76. <path
  77. d="M24.7 4c.4 0 .6 0 .8.1.2.1.3.2.4.4.1.2.1.3.1.8V22h16.7c.4 0 .6 0 .8.1.2.1.3.2.4.4.1.2.1.3.1.8v1.4c0 .4 0 .6-.1.8-.1.2-.2.3-.4.4-.2.1-.3.1-.8.1H26v16.7c0 .4 0 .6-.1.8-.1.2-.2.3-.4.4-.2.1-.3.1-.8.1h-1.4c-.4 0-.6 0-.8-.1-.2-.1-.3-.2-.4-.4-.1-.2-.1-.3-.1-.8V26H5.3c-.4 0-.6 0-.8-.1-.2-.1-.3-.2-.4-.4-.1-.2-.1-.3-.1-.8v-1.4c0-.4 0-.6.1-.8.1-.2.2-.3.4-.4.2-.1.3-.1.8-.1H22V5.3c0-.4 0-.6.1-.8.1-.2.2-.3.4-.4.2-.1.3-.1.8-.1h1.4z">
  78. </path>
  79. </svg></i>
  80. <span class="add-label">填写充值手机号</span>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. <p class="label">物品信息</p>
  86. <div v-if="activeName == 'goodsNotice'">
  87. <table class="table">
  88. <thead>
  89. <tr>
  90. <th width="25%">兑换物品</th>
  91. <th style="text-align: center">数量</th>
  92. <th style="text-align: center">单价</th>
  93. <th style="text-align: center" width="15%">
  94. <span style="color: red">*</span>兑换方式
  95. </th>
  96. <th v-if="deliveryType == '0'" style="text-align: center" width="15%">
  97. <span style="color: red">*</span>领取地点
  98. </th>
  99. <th style="text-align: center">总计</th>
  100. </tr>
  101. </thead>
  102. <tbody>
  103. <tr>
  104. <td>
  105. <div class="prize-info">
  106. <div class="prize-img-container">
  107. <el-image :src="data.imgUrl" v-if="data.imgUrl" :preview-src-list="imgUrls.length==0?[data.imgUrl]:imgUrls"
  108. class="prize-img"></el-image>
  109. </div>
  110. <div class="prize-detail-info">
  111. <h3 class="title" @click="handleClickGood(data.skuId)">{{ data.name }}</h3>
  112. <!-- <p class="desc">
  113. <span v-if="data.location">{{ data.location }}</span>
  114. </p> -->
  115. </div>
  116. </div>
  117. </td>
  118. <td style="text-align: center">
  119. <el-input-number @change="changeCount" size="mini" v-model="skuCount" :step="1" :min="1"
  120. step-strictly></el-input-number>
  121. </td>
  122. <td style="text-align: center">{{ data.price }} 积分</td>
  123. <td style="text-align: center">
  124. <el-select size="small" clearable v-model="deliveryType" placeholder="请选择" value-key="value"
  125. @change="changeDeliveryType">
  126. <el-option :key="item.dictValue" v-for="item in deliveryTypeList"
  127. :label="item.dictLabel" :value="item.dictValue">
  128. </el-option>
  129. </el-select>
  130. </td>
  131. <td v-if="deliveryType == '0'" style="text-align: center">
  132. <el-select size="small" clearable v-model="reclaimAddr" placeholder="请选择" value-key="value"
  133. @change="changeReclaimAddr">
  134. <el-option :key="item.dictValue" v-for="item in reclaimAddrList" :label="item.dictLabel"
  135. :value="item.dictValue">
  136. </el-option>
  137. </el-select>
  138. </td>
  139. <td style="text-align: center" class="finlly-price">
  140. {{ total }} 积分
  141. </td>
  142. </tr>
  143. </tbody>
  144. </table>
  145. </div>
  146. <div v-else>
  147. <table class="table">
  148. <thead>
  149. <tr>
  150. <th width="35%">兑换物品</th>
  151. <th style="text-align: center">消耗福利券</th>
  152. <th style="text-align: center">物品属性</th>
  153. <th style="text-align: center" width="20%">
  154. <span style="color: red">*</span>兑换方式
  155. </th>
  156. </tr>
  157. </thead>
  158. <tbody>
  159. <tr>
  160. <td>
  161. <div class="prize-info">
  162. <div class="prize-img-container">
  163. <el-image :src="data.imgUrl" v-if="data.imgUrl" :preview-src-list="[data.imgUrl]"
  164. class="prize-img"></el-image>
  165. </div>
  166. <div class="prize-detail-info">
  167. <h3 class="title">{{ data.name }}</h3>
  168. <!-- <p class="desc">
  169. <span v-if="data.location">{{ data.location }}</span>
  170. </p> -->
  171. </div>
  172. </div>
  173. </td>
  174. <td style="text-align: center">{{ data.title }}</td>
  175. <td style="text-align: center">
  176. {{ data.productAttributeName }}
  177. </td>
  178. <td style="text-align: center" class="finlly-price">
  179. <el-select size="small" clearable v-model="deliveryType" placeholder="请选择" value-key="value"
  180. @change="changeDeliveryType">
  181. <el-option :key="item.dictValue" v-for="item in deliveryTypeList"
  182. :label="item.dictLabel" :value="item.dictValue">
  183. </el-option>
  184. </el-select>
  185. </td>
  186. </tr>
  187. </tbody>
  188. </table>
  189. </div>
  190. <div class="footer">
  191. <div class="right" v-if="data.stock != 0">
  192. <div class="btn-line">
  193. <el-button :disabled="disabled" @click="dialogVisible = true" type="primary" round>确认兑换</el-button>
  194. </div>
  195. </div>
  196. </div>
  197. </el-card>
  198. <el-dialog title="兑换物品收货地址" :visible.sync="dialogFormVisible" width="500px">
  199. <el-form label-position="left" :model="dataForm" ref="dataForm" style="padding: 0 75px" :rules="rules">
  200. <el-form-item label="联系姓名" :label-width="formLabelWidth" prop="name">
  201. <el-input size="medium" v-model="dataForm.name" placeholder="请输入联系姓名"></el-input>
  202. </el-form-item>
  203. <el-form-item label="联系方式" :label-width="formLabelWidth" prop="phone">
  204. <el-input size="medium" v-model="dataForm.phone" placeholder="请输入11位手机号码"></el-input>
  205. </el-form-item>
  206. <el-form-item label="省市区" :label-width="formLabelWidth" prop="addressArr">
  207. <el-cascader style="width: 100%" clearable placeholder="请选择省市区" size="medium" :options="options"
  208. v-model="dataForm.addressArr" @change="handleChange">
  209. </el-cascader>
  210. </el-form-item>
  211. <el-form-item label="街道" :label-width="formLabelWidth" prop="street">
  212. <el-input size="medium" v-model="dataForm.street" placeholder="请输入街道"></el-input>
  213. </el-form-item>
  214. <el-form-item label="详细地址" :label-width="formLabelWidth" prop="address">
  215. <el-input size="medium" v-model="dataForm.address" placeholder="请输入小区楼栋/乡村名称"></el-input>
  216. </el-form-item>
  217. </el-form>
  218. <div slot="footer" class="dialog-footer" style="text-align: center">
  219. <el-button class="addButton-address" type="primary" @click="submitForm('dataForm')">提交</el-button>
  220. </div>
  221. </el-dialog>
  222. <el-dialog title="手机充值" :visible.sync="dialogFormPhoneNumber" width="500px">
  223. <el-form :model="dataFormPhoneNumber" ref="dataFormPhoneNumber" :rules="rules">
  224. <el-form-item label="充值手机" :label-width="formLabelWidth" prop="phoneNumber">
  225. <el-input size="medium" v-model="dataFormPhoneNumber.phoneNumber" placeholder="请输入11位手机号码"></el-input>
  226. </el-form-item>
  227. </el-form>
  228. <div slot="footer" class="dialog-footer" style="text-align: center">
  229. <el-button class="addButton-address" type="primary"
  230. @click="submitFormPhoneNumber('dataFormPhoneNumber')">提交</el-button>
  231. </div>
  232. </el-dialog>
  233. <el-dialog title="结算明细" :visible.sync="dialogFormOrderInfo" width="300px">
  234. <div class="checklist">
  235. <div class="listItem">
  236. <div class="itemName">商品积分</div>
  237. <div class="itemValue">{{ data.price }}</div>
  238. </div>
  239. <div class="listItem">
  240. <div class="itemName">商品数量</div>
  241. <div class="itemValue">{{ skuCount }}</div>
  242. </div>
  243. <div class="listItem">
  244. <div class="itemName">快递积分</div>
  245. <div class="itemValue red">+180</div>
  246. </div>
  247. <div class="listItem">
  248. <div class="itemName">合计</div>
  249. <div class="itemValue">{{ total }}</div>
  250. </div>
  251. </div>
  252. <div slot="footer" class="dialog-footer" style="text-align: center">
  253. <el-button class="addButton-address" type="primary" style="
  254. background-image: linear-gradient(to right, #f5b543, #faa029);
  255. width: 100px;
  256. height: 35px;
  257. line-height: 34px;
  258. " @click="handleClickOrderInfo">确定</el-button>
  259. </div>
  260. </el-dialog>
  261. <el-dialog :visible.sync="dialogMsgVisible" width="400px" @close="handleClose">
  262. <div class="wrapper">
  263. <svg width="291" height="93" viewBox="0 0 291 93" fill="none" xmlns="http://www.w3.org/2000/svg"
  264. src="./success.svg" class="success-icon">
  265. <g filter="url(#filter0_f_6844:108643)">
  266. <circle cx="143" cy="56.5723" r="3" fill="#51F1E8"></circle>
  267. </g>
  268. <path d="M195.768 48.1699L195.768 39.5097L203.268 43.8398L195.768 48.1699Z" fill="#FF5E54"></path>
  269. <path d="M232.39 10.953L230.149 2.58781L238.514 4.82925L232.39 10.953Z" fill="#9F54FF"></path>
  270. <path d="M7.519 27.6623L1.39528 21.5385L9.76044 19.2971L7.519 27.6623Z" fill="#FF834E"></path>
  271. <path
  272. d="M106.774 8.99609L96.2168 11.168C94.5498 27.4571 102.885 34.5158 107.886 36.6877C113.999 37.7736 120.031 35.8701 124 32.8869C111.22 33.4298 104.552 19.3126 106.774 8.99609Z"
  273. fill="#51F1E8"></path>
  274. <path
  275. d="M283.89 68.9961L290.383 70.4176C292.692 77.5253 288.076 83.9223 283.89 84.9096C280.384 85.3438 277.597 84.0817 275 82.5007C284.452 83.364 285.768 73.9715 283.89 68.9961Z"
  276. fill="#FF5E54"></path>
  277. <g filter="url(#filter1_f_6844:108643)">
  278. <path
  279. d="M50 82.4171L55.3529 77.9961C57.902 79.4698 63 83.3014 63 86.8382C59.8213 88.1508 58.6931 89.8153 58.427 90.9879C58.4503 91.3588 58.4426 91.6987 58.4118 91.9961C58.3461 91.7429 58.3346 91.395 58.427 90.9879C58.2575 88.2958 56.4523 83.9714 50 82.4171Z"
  280. fill="#FFCF8B"></path>
  281. </g>
  282. <defs data-v-50d84ad4="">
  283. <filter id="filter0_f_6844:108643" x="139" y="52.5723" width="8" height="8"
  284. filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
  285. <feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood>
  286. <feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend>
  287. <feGaussianBlur stdDeviation="0.5" result="effect1_foregroundBlur_6844:108643"></feGaussianBlur>
  288. </filter>
  289. <filter id="filter1_f_6844:108643" x="49" y="76.9961" width="15" height="16"
  290. filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
  291. <feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood>
  292. <feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend>
  293. <feGaussianBlur stdDeviation="0.5" result="effect1_foregroundBlur_6844:108643"></feGaussianBlur>
  294. </filter>
  295. </defs>
  296. </svg>
  297. <h2 class="header">恭喜你,兑换成功!</h2>
  298. <img :src="data.imgUrl" class="icon" />
  299. <div class="desc">
  300. <span>已下单,经过审批后,2周内发货,如有问题联系物品介绍中备注的相关联系人</span>
  301. <!-- <span>恭喜你成功兑换{{ data.name }},随后你可在</span>
  302. <a href="/home/myCenter" class="link">个人中心</a>中查看兑换的物品 -->
  303. </div>
  304. </div>
  305. <div slot="footer" class="dialog-footer" style="text-align: center">
  306. <router-link to="/home/myCenter">
  307. <el-button @click="setTab" class="addButton-address" type="primary">
  308. 查看物品
  309. </el-button>
  310. </router-link>
  311. </div>
  312. </el-dialog>
  313. <el-dialog title="兑换确认" :visible.sync="dialogVisible" width="30%">
  314. <div class="checklist">
  315. <div class="listItem">
  316. <div class="itemName">商品名称</div>
  317. <div class="itemValue">{{ data.name }}</div>
  318. </div>
  319. <div class="listItem">
  320. <div class="itemName">商品积分</div>
  321. <div class="itemValue">{{ data.price }}</div>
  322. </div>
  323. <div class="listItem">
  324. <div class="itemName">商品数量</div>
  325. <div class="itemValue">{{ skuCount }}</div>
  326. </div>
  327. <div v-if="deliveryType == '1' && data.productAttribute == 'exchange_logo'" class="listItem">
  328. <div class="itemName">快递积分</div>
  329. <div class="itemValue red">+180</div>
  330. </div>
  331. <div class="listItem">
  332. <div class="itemName">兑换方式</div>
  333. <div class="itemValue">{{ deliveryTypeName }}</div>
  334. </div>
  335. <div v-if="deliveryType == '0'" class="listItem">
  336. <div class="itemName">领取地点</div>
  337. <div class="itemValue">{{ reclaimAddrName }}</div>
  338. </div>
  339. <div class="listItem">
  340. <div class="itemName">合计</div>
  341. <div class="itemValue">{{ total }}</div>
  342. </div>
  343. </div>
  344. <span slot="footer" class="dialog-footer">
  345. <el-button @click="dialogVisible = false">取 消</el-button>
  346. <el-button type="primary" @click="handleClickExchange">确 定</el-button>
  347. </span>
  348. </el-dialog>
  349. </div>
  350. </template>
  351. <script>
  352. import { integralInfo, festivalInfo, start, kill } from "@/api/allApi";
  353. import {regionData,codeToText,} from "element-china-area-data";
  354. import { setTab } from "@/utils/auth";
  355. import { debounce } from "@/utils/index";
  356. export default {
  357. data() {
  358. var validPhone = (rule, value, callback) => {
  359. if (value === "") {
  360. callback(new Error("请输入手机号"));
  361. } else {
  362. const reg_tel =
  363. /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
  364. const isCheckPhone = reg_tel.test(value);
  365. if (!isCheckPhone) {
  366. callback(new Error("请输入正确手机号"));
  367. }
  368. callback();
  369. }
  370. };
  371. return {
  372. dialogVisible:false,
  373. options: regionData,
  374. reclaimAddr: "",
  375. reclaimAddrName: "",
  376. reclaimAddrList: [],
  377. phoneNumber: "",
  378. deliveryTypeList: [],
  379. deliveryType: "",
  380. deliveryTypeName:"",
  381. contactInfo: {},
  382. activeName: this.$route.query.activeName,
  383. name: "",
  384. phone: "",
  385. addressArr: [],
  386. addressStr: "",
  387. street: "",
  388. address: "",
  389. disabled: true,
  390. skuCount: 1,
  391. total: undefined,
  392. data: {},
  393. imgUrls:[],
  394. dialogFormOrderInfo: false,
  395. dialogFormPhoneNumber: false,
  396. addressDetail: false,
  397. dialogFormVisible: false,
  398. dialogMsgVisible: false,
  399. dataFormPhoneNumber: {
  400. phoneNumber: "",
  401. },
  402. dataForm: {
  403. name: "",
  404. phone: "",
  405. addressArr: [],
  406. addressStr: "",
  407. street: "",
  408. address: "",
  409. },
  410. rules: {
  411. name: [
  412. { required: true, message: "请输入联系姓名", trigger: "blur" },
  413. {
  414. min: 1,
  415. max: 25,
  416. message: "长度在 1 到 25 个字符",
  417. trigger: "blur",
  418. },
  419. ],
  420. phone: [{ required: true, validator: validPhone, trigger: "blur" }],
  421. addressArr: [
  422. { required: true, message: "请选择省市区", trigger: "blur" },
  423. ],
  424. street: [
  425. { required: true, message: "请输入街道", trigger: "blur" },
  426. {
  427. min: 1,
  428. max: 120,
  429. message: "长度在 1 到 120 个字符",
  430. trigger: "blur",
  431. },
  432. ],
  433. address: [
  434. {
  435. required: true,
  436. message: "请输入小区楼栋/乡村名称",
  437. trigger: "blur",
  438. },
  439. {
  440. min: 1,
  441. max: 120,
  442. message: "长度在 1 到 120 个字符",
  443. trigger: "blur",
  444. },
  445. ],
  446. phoneNumber: [
  447. { required: true, validator: validPhone, trigger: "blur" },
  448. ],
  449. },
  450. formLabelWidth: "80px",
  451. };
  452. },
  453. created() {
  454. const skuId = this.$route.query.id;
  455. const activeName = this.$route.query.activeName;
  456. this.dataForm.skuId = skuId;
  457. this.getInfo(skuId, activeName);
  458. },
  459. methods: {
  460. handleClickGood(id) {
  461. this.$router.push({
  462. path: '/home/pointsMall/goodDetail',
  463. query: {
  464. id: id,
  465. }
  466. });
  467. },
  468. handleClick(){
  469. this.dialogVisible = true;
  470. },
  471. handleChange(value) {
  472. console.log(value);
  473. var loc = "";
  474. for (let i = 0; i < value.length; i++) {
  475. loc += codeToText[value[i]];
  476. }
  477. console.log(loc); //打印区域码所对应的属性值即中文地址
  478. this.dataForm.addressStr = loc;
  479. },
  480. handleClickOrderInfo() {
  481. this.dialogFormOrderInfo = false;
  482. },
  483. changeReclaimAddr(val) {
  484. this.disabled = true;
  485. if (val) {
  486. this.disabled = false;
  487. }
  488. this.reclaimAddrName = this.reclaimAddrList.find(item => item.dictValue == val).dictLabel;
  489. },
  490. changeDeliveryType(val) {
  491. this.reclaimAddr = '';
  492. this.disabled = true;
  493. if (val == "0" || val == "") {
  494. this.total = this.data.price;
  495. this.skuCount = 1;
  496. }
  497. if (val == "1") {
  498. debugger;
  499. if (this.data.productAttribute == "exchange_logo") {
  500. this.total = this.data.price * this.skuCount + 180;
  501. this.dialogFormOrderInfo = true;
  502. }
  503. if (this.address) {
  504. this.addressDetail = true;
  505. this.disabled = false;
  506. }
  507. }
  508. if (val == "2" || val == "3") {
  509. this.total = this.data.price;
  510. this.skuCount = 1;
  511. this.disabled = false;
  512. }
  513. if (val == "4") {
  514. this.total = this.data.price;
  515. this.skuCount = 1;
  516. if (this.phoneNumber) {
  517. this.disabled = false;
  518. }
  519. }
  520. this.deliveryTypeName = this.deliveryTypeList.find(item => item.dictValue == val).dictLabel;
  521. },
  522. setTab() {
  523. setTab("exchange");
  524. },
  525. changeCount(val) {
  526. this.total = this.data.price * val;
  527. if (
  528. this.deliveryType == "1" &&
  529. this.data.productAttribute == "exchange_logo"
  530. ) {
  531. this.total = this.data.price * val + 180;
  532. }
  533. },
  534. handleClose() {
  535. this.dialogMsgVisible = false;
  536. this.$router.push({
  537. path: "/home/pointsMall",
  538. });
  539. },
  540. getInfo(skuId, activeName) {
  541. if (activeName == "goodsNotice") {
  542. integralInfo({ skuId: skuId })
  543. .then((response) => {
  544. this.data = response.data.data;
  545. this.deliveryTypeList = response.data.data.dictDataList;
  546. this.reclaimAddrList = response.data.data.reclaimAddrList;
  547. this.contactInfo = response.data.data.contactInfo;
  548. if (this.contactInfo) {
  549. this.name = this.contactInfo.contact;
  550. this.phone = this.contactInfo.contactPhone;
  551. this.addressArr = this.contactInfo.addressArr;
  552. this.addressStr = this.contactInfo.addressStr;
  553. this.street = this.contactInfo.street;
  554. this.address = this.contactInfo.contactAddr;
  555. }
  556. this.total = response.data.data.price;
  557. let imgs = response.data.data.imgs;
  558. if(imgs){
  559. imgs.forEach(element => {
  560. this.imgUrls.push(element.url);
  561. });
  562. }
  563. })
  564. .catch(() => { });
  565. } else {
  566. festivalInfo({ skuId: skuId })
  567. .then((response) => {
  568. this.data = response.data.data;
  569. this.contactInfo = response.data.data.contactInfo;
  570. this.deliveryTypeList = response.data.data.dictDataList;
  571. if (this.contactInfo) {
  572. this.name = this.contactInfo.contact;
  573. this.phone = this.contactInfo.contactPhone;
  574. this.addressArr = this.contactInfo.addressArr;
  575. this.addressStr = this.contactInfo.addressStr;
  576. this.street = this.contactInfo.street;
  577. this.address = this.contactInfo.contactAddr;
  578. }
  579. })
  580. .catch(() => { });
  581. }
  582. },
  583. handleClickPhoneNumber() {
  584. this.dialogFormPhoneNumber = true;
  585. this.dataFormPhoneNumber.phoneNumber = this.phoneNumber;
  586. },
  587. handleClickAddress() {
  588. this.dialogFormVisible = true;
  589. this.dataForm.name = this.name;
  590. this.dataForm.phone = this.phone;
  591. this.dataForm.addressArr = this.addressArr;
  592. this.dataForm.addressStr = this.addressStr;
  593. this.dataForm.street = this.street;
  594. this.dataForm.address = this.address;
  595. },
  596. submitFormPhoneNumber(formName) {
  597. this.$refs[formName].validate((valid) => {
  598. if (valid) {
  599. (this.phoneNumber = this.dataFormPhoneNumber.phoneNumber),
  600. (this.dialogFormPhoneNumber = false);
  601. this.disabled = false;
  602. } else {
  603. console.log("error submit!!");
  604. return false;
  605. }
  606. });
  607. },
  608. submitForm(formName) {
  609. this.$refs[formName].validate((valid) => {
  610. if (valid) {
  611. // alert('submit!');
  612. (this.name = this.dataForm.name),
  613. (this.phone = this.dataForm.phone),
  614. (this.addressArr = this.dataForm.addressArr),
  615. (this.addressStr = this.dataForm.addressStr),
  616. (this.street = this.dataForm.street),
  617. (this.address = this.dataForm.address),
  618. (this.addressDetail = true);
  619. this.dialogFormVisible = false;
  620. this.disabled = false;
  621. } else {
  622. console.log("error submit!!");
  623. return false;
  624. }
  625. });
  626. },
  627. submit() {
  628. this.dialogVisible = false;
  629. if (this.deliveryType == "1") {
  630. var params = {
  631. skuId: this.data.skuId,
  632. skuCount: this.skuCount,
  633. price: this.data.price,
  634. deliveryType: this.deliveryType,
  635. contact: this.name,
  636. contactPhone: this.phone,
  637. addressArr: this.addressArr,
  638. addressStr: this.addressStr,
  639. street: this.street,
  640. contactAddr: this.address,
  641. skuType: this.data.skuType,
  642. welfareId: this.data.welfareId,
  643. };
  644. } else if (this.deliveryType == "4") {
  645. var params = {
  646. skuId: this.data.skuId,
  647. skuCount: this.skuCount,
  648. price: this.data.price,
  649. deliveryType: this.deliveryType,
  650. contactPhone: this.phoneNumber,
  651. skuType: this.data.skuType,
  652. welfareId: this.data.welfareId,
  653. };
  654. } else {
  655. var params = {
  656. skuId: this.data.skuId,
  657. skuCount: this.skuCount,
  658. price: this.data.price,
  659. deliveryType: this.deliveryType,
  660. reclaimAddr: this.reclaimAddr,
  661. skuType: this.data.skuType,
  662. welfareId: this.data.welfareId,
  663. };
  664. }
  665. if (this.activeName == "goodsNotice") {
  666. start(params)
  667. .then((response) => {
  668. console.log(response.data.data);
  669. this.$store.dispatch("GetUserInfo");
  670. this.dialogMsgVisible = true;
  671. })
  672. .catch(() => { });
  673. } else {
  674. kill(params)
  675. .then((response) => {
  676. console.log(response.data.data);
  677. this.$store.dispatch("GetUserInfo");
  678. this.dialogMsgVisible = true;
  679. })
  680. .catch(() => { });
  681. }
  682. },
  683. handleClickExchange: debounce(
  684. function () {
  685. this.submit();
  686. },
  687. 2000,
  688. true
  689. ),
  690. },
  691. };
  692. </script>
  693. <style scoped>
  694. .red {
  695. color: red;
  696. }
  697. /* .checklist{
  698. } */
  699. .listItem {
  700. display: flex;
  701. justify-content: space-between;
  702. align-content: center;
  703. padding: 5px 0;
  704. }
  705. /* .itemName{
  706. } */
  707. /* .itemValue{
  708. } */
  709. .clearfix:before,
  710. .clearfix:after {
  711. display: table;
  712. content: "";
  713. }
  714. .clearfix:after {
  715. clear: both;
  716. }
  717. .box-card {
  718. width: 100%;
  719. }
  720. /* .label:first-child {
  721. margin-top: 0;
  722. } */
  723. .label {
  724. font-size: 16px;
  725. line-height: 24px;
  726. margin: 16px 0 24px;
  727. }
  728. .address-container {
  729. padding: 16px;
  730. min-height: 112px;
  731. background-color: #f7f8fa;
  732. box-sizing: border-box;
  733. border-radius: 4px;
  734. width: 320px;
  735. border: 1px solid #abcdff;
  736. }
  737. .address-container .header {
  738. font-weight: 500;
  739. font-size: 14px;
  740. line-height: 24px;
  741. color: #252933;
  742. display: flex;
  743. justify-content: space-between;
  744. margin: 0 0 8px;
  745. }
  746. .address-container .header .left {
  747. display: flex;
  748. justify-content: center;
  749. align-items: center;
  750. }
  751. .address-container .btn {
  752. flex: none;
  753. color: #1e80ff;
  754. cursor: pointer;
  755. font-weight: 400;
  756. margin-left: 1em;
  757. }
  758. .address-container .address,
  759. .address-container .phone {
  760. margin: 0;
  761. font-size: 14px;
  762. line-height: 24px;
  763. color: #515767;
  764. }
  765. .address-container.new {
  766. border: 1px dashed #e4e6eb;
  767. width: 100%;
  768. display: flex;
  769. align-items: center;
  770. justify-content: center;
  771. cursor: pointer;
  772. flex-flow: column nowrap;
  773. }
  774. .address-container {
  775. padding: 16px;
  776. min-height: 112px;
  777. background-color: #f7f8fa;
  778. box-sizing: border-box;
  779. border-radius: 4px;
  780. width: 320px;
  781. border: 1px solid #abcdff;
  782. }
  783. .address-container.new .add-icon {
  784. font-size: 16px;
  785. color: #515767;
  786. }
  787. .byte-icon {
  788. width: 1em;
  789. height: 1em;
  790. display: inline-block;
  791. vertical-align: middle;
  792. line-height: 1;
  793. }
  794. svg:not(:root) {
  795. overflow-clip-margin: content-box;
  796. overflow: hidden;
  797. }
  798. .byte-icon svg {
  799. width: 100%;
  800. height: 100%;
  801. fill: currentColor;
  802. pointer-events: none;
  803. }
  804. .address-container.new .add-label {
  805. font-size: 14px;
  806. line-height: 24px;
  807. color: #8a919f;
  808. margin: 18px 0 0;
  809. }
  810. .table {
  811. border-collapse: collapse;
  812. border: 1px solid #e4e6eb;
  813. box-sizing: border-box;
  814. border-radius: 2px;
  815. width: 100%;
  816. text-align: left;
  817. font-size: 14px;
  818. line-height: 24px;
  819. border-collapse: separate;
  820. border-spacing: 0;
  821. border-radius: 4px;
  822. }
  823. .table tr {
  824. border: 1px solid #e4e6eb;
  825. }
  826. .table th {
  827. padding: 12px 16px;
  828. background-color: #f7f8fa;
  829. font-weight: 500;
  830. color: #282f38;
  831. }
  832. .table td {
  833. padding: 16px;
  834. vertical-align: middle;
  835. color: #515767;
  836. }
  837. .table .prize-info {
  838. display: flex;
  839. }
  840. .table .prize-img-container {
  841. display: flex;
  842. align-items: center;
  843. justify-content: center;
  844. background: #f7f8fa;
  845. max-width: 80px;
  846. height: 80px;
  847. }
  848. .table .prize-detail-info {
  849. margin-left: 16px;
  850. display: flex;
  851. flex-flow: column;
  852. align-items: flex-start;
  853. justify-content: center;
  854. }
  855. .table .prize-img-container .prize-img {
  856. max-height: 64px;
  857. }
  858. .lazy {
  859. position: relative;
  860. -o-object-fit: cover;
  861. object-fit: cover;
  862. }
  863. img {
  864. border-style: none;
  865. }
  866. .table .prize-detail-info {
  867. margin-left: 16px;
  868. display: flex;
  869. flex-flow: column;
  870. align-items: flex-start;
  871. justify-content: center;
  872. }
  873. .table .prize-detail-info .title {
  874. cursor: pointer;
  875. font-weight: 400;
  876. font-size: 14px;
  877. line-height: 24px;
  878. color: #1d2129;
  879. margin: 0 0 3px;
  880. }
  881. .table .prize-detail-info .desc {
  882. margin: 0;
  883. line-height: 18px;
  884. height: 18px;
  885. }
  886. .table .prize-detail-info .desc span {
  887. font-size: 12px;
  888. line-height: 14px;
  889. color: #ff7d00;
  890. background: #fff7e8;
  891. padding: 2px 4px;
  892. }
  893. .table .finlly-price {
  894. font-weight: 500;
  895. font-size: 14px;
  896. line-height: 24px;
  897. color: #1e80ff;
  898. }
  899. .footer {
  900. margin-top: 16px;
  901. /* display: flex;
  902. justify-content: space-between; */
  903. }
  904. .footer .left-info {
  905. box-sizing: border-box;
  906. width: 400px;
  907. height: -webkit-fit-content;
  908. height: -moz-fit-content;
  909. height: fit-content;
  910. background-color: #e8f3ff;
  911. border-radius: 4px;
  912. padding: 16px;
  913. }
  914. .footer .left-info .info-title {
  915. font-size: 14px;
  916. line-height: 24px;
  917. color: #282f38;
  918. display: flex;
  919. align-items: center;
  920. }
  921. .footer .left-info .info-icon {
  922. margin-right: 8px;
  923. }
  924. .footer .left-info .info-content {
  925. margin: 4px 0 4px 2em;
  926. white-space: pre-line;
  927. font-size: 12px;
  928. line-height: 20px;
  929. color: #8a919f;
  930. }
  931. .footer .right {
  932. font-size: 14px;
  933. line-height: 24px;
  934. color: #282f38;
  935. }
  936. .footer .right .remark-line {
  937. display: flex;
  938. position: relative;
  939. }
  940. .footer .right .remark {
  941. width: 400px;
  942. }
  943. .footer .right .btn-line {
  944. margin-top: 16px;
  945. text-align: right;
  946. }
  947. .addButton-address {
  948. background: #1e80ff;
  949. border-color: #1e80ff;
  950. color: #fff;
  951. width: 160px;
  952. height: 48px;
  953. border-radius: 50px;
  954. line-height: 46px;
  955. padding: 0;
  956. font-size: 16px;
  957. border: 1px solid transparent;
  958. }
  959. .wrapper .icon {
  960. height: 88px;
  961. margin-bottom: 24px;
  962. max-width: 300px;
  963. }
  964. </style>
  965. <style>
  966. .el-dialog__body {
  967. padding-bottom: 0px;
  968. padding-top: 10px;
  969. }
  970. </style>