coupon-item-edit.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767
  1. <template>
  2. <view class="special-item-edit-page">
  3. <scroll-view scroll-y class="scroll-content">
  4. <view class="cell-wrap">
  5. <view class="item">
  6. <view class="label"><span class="required">*</span>优惠券标题</view>
  7. <view class="value">
  8. <input border="none" inputAlign="right" maxlength="15" fontSize="14" v-model="form.couponName" placeholder="请填写"></input>
  9. </view>
  10. </view>
  11. <view class="item">
  12. <view class="label"><span class="required">*</span>子标题</view>
  13. <view class="value">
  14. <input border="none" inputAlign="right" maxlength="15" fontSize="14" v-model="form.couponTitle" placeholder="请填写"></input>
  15. </view>
  16. </view>
  17. <view class="item dubble">
  18. <view class="row">
  19. <view class="label">优惠券图片</view>
  20. <view class="value">
  21. <u-upload :fileList="fileList" @afterRead="afterRead" @delete="deletePic" name="1"
  22. :previewFullImage="true" :maxCount="1"></u-upload>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="item">
  27. <view class="label"><span class="required">*</span>优惠类型</view>
  28. <view class="value">
  29. <uni-data-select
  30. v-model="form.discountType"
  31. :localdata="discountTypeList"
  32. @change="changeDiscountType"
  33. :border="false"
  34. ></uni-data-select>
  35. </view>
  36. </view>
  37. <view class="item" v-if="form.discountType === 1">
  38. <view class="label"><span class="required">*</span>满减标准金额</view>
  39. <view class="value">
  40. <input border="none" inputAlign="right" maxlength="15" fontSize="14" v-model="form.couponFullPrice" placeholder="请填写"></input>
  41. </view>
  42. </view>
  43. <view class="item" v-if="form.discountType !== 3 && form.discountType !== 4">
  44. <view class="label"><span class="required">*</span>面额</view>
  45. <view class="value">
  46. <input border="none" inputAlign="right" maxlength="15" fontSize="14" v-model="form.price" placeholder="请填写"></input>
  47. </view>
  48. </view>
  49. <view class="item" v-if="form.discountType === 3">
  50. <view class="label"><span class="required">*</span>折扣(%)</view>
  51. <view class="value">
  52. <input border="none" inputAlign="right" maxlength="15" fontSize="14" v-model="form.couponDiscount" placeholder="请填写"></input>
  53. </view>
  54. </view>
  55. <view class="item">
  56. <view class="label"><span class="required">*</span>可领取人群</view>
  57. <view class="value">
  58. <uni-data-select
  59. v-model="form.useScopeMember"
  60. :localdata="useScopeMemberList"
  61. @change="changeUseScopeMember"
  62. :border="false"
  63. ></uni-data-select>
  64. </view>
  65. </view>
  66. <view class="item">
  67. <view class="label"><span class="required">*</span>活动时间</view>
  68. <view class="value" @click="selectDate">
  69. {{ form.startDate }} ~ {{ form.endDate }}
  70. </view>
  71. </view>
  72. <view class="item">
  73. <view class="label"><span class="required">*</span>优惠券状态</view>
  74. <view class="value">
  75. <switch :checked="form.status" @change="changeStatus" size="22" class="switch" style="transform:scale(0.7)"></switch>
  76. </view>
  77. </view>
  78. <view class="item">
  79. <view class="label"><span class="required">*</span>发行数量</view>
  80. <view class="value">
  81. <input border="none" inputAlign="right" maxlength="15" fontSize="14" v-model="form.publishNum" placeholder="请填写"></input>
  82. </view>
  83. </view>
  84. <view class="item">
  85. <view class="label">说明</view>
  86. <view class="value">
  87. <input border="none" inputAlign="right" maxlength="15" fontSize="14" v-model="form.remark" placeholder="请填写"></input>
  88. </view>
  89. </view>
  90. </view>
  91. <view class="activities-title" v-if="form.discountType === 4"><span class="required">*</span>
  92. 参与的商品(不支持多规格商品)
  93. </view>
  94. <view class="goods-list" v-if="form.discountType === 4">
  95. <uni-swipe-action>
  96. <uni-swipe-action-item :right-options="addFlag ? options : options1" :index="index" v-for="(item, index) in goodsList"
  97. @click="deleteGoods(index,item)" :key="item.goodsId">
  98. <view class="goods">
  99. <view class="cover">
  100. <image class="img" :src="item.pictureUrl"/>
  101. </view>
  102. <view class="cont">
  103. <view class="name">{{item.goodsName}}</view>
  104. </view>
  105. <view >
  106. <!-- <view class="desc">每单限购{{item.maxNum}}份,活动库存{{item.activityNum}}份</view> -->
  107. <u-icon style="margin-right: 10rpx;" name="edit-pen" size="28" color="#6c6c6c" @click="handEditGoods(item, index)"></u-icon>
  108. </view>
  109. </view>
  110. </uni-swipe-action-item>
  111. </uni-swipe-action>
  112. <view class="add-goods" v-if="form.discountType === 4 && addFlag && goodsList.length < 1" @click="handAddGoods">添加商品</view>
  113. </view>
  114. </scroll-view>
  115. <u-modal
  116. :show="updateStatusVisible"
  117. title="注意"
  118. closeOnClickOverlay
  119. showCancelButton
  120. @confirm="pushGoods"
  121. @close="updateStatusVisible = false"
  122. @cancel="updateStatusVisible = false">
  123. <view class="container">
  124. 活动中的商品如果参加首页推荐,活动状态改变后将会在首页、店铺同步下架,您是否确定改变?
  125. </view>
  126. </u-modal>
  127. <uni-calendar ref="calendar" class="uni-calendar--hook" :clear-date="true" :insert="false" :range="true" @confirm="confirm" />
  128. <view class="update-events">
  129. <view class="btn" @click="save">保存</view>
  130. </view>
  131. </view>
  132. </template>
  133. <script>
  134. import {mapState} from 'vuex';
  135. import { computed } from "vue";
  136. export default {
  137. data () {
  138. return {
  139. getStoreCouponByIdForStore: '/coupon/getStoreCouponByIdForStore',
  140. saveUrl: '/coupon/updateCouponByStore',
  141. updateStatusVisible: false,
  142. form: {
  143. couponId: '',
  144. couponName: '',
  145. couponTitle: '',
  146. discountType: '',
  147. couponType: 2,
  148. couponDiscount: '',
  149. couponFullPrice: '',
  150. imgUrl: '',
  151. storeId: '',
  152. goodsId: '',
  153. useScopeMember: '',
  154. startDate: '',
  155. endDate: '',
  156. status: 0,
  157. price: '',
  158. publishNum: '',
  159. receivedNum: '',
  160. usedNum: '',
  161. remark: ''
  162. },
  163. goodsList: [],
  164. fileList: [],
  165. options: [
  166. {
  167. text: '删除',
  168. style: {
  169. fontSize: '28rpx',
  170. backgroundColor: '#FF0000',
  171. marginBottom: '20rpx'
  172. }
  173. }
  174. ],
  175. options1:[],
  176. addFlag: true,
  177. file: {},
  178. event: {},
  179. discountTypeList: [
  180. { value: 1, text: "满减券" },
  181. { value: 2, text: "抵扣券" },
  182. { value: 3, text: "折扣券" },
  183. { value: 4, text: "兑换券" },
  184. ],
  185. useScopeMemberList: [
  186. {value: 1, text: '周期内限领'},
  187. {value: 2, text: '注册周期内累计消费'},
  188. {value: 3, text: '注册周期'},
  189. {value: 4, text: '新用户'}
  190. ],
  191. }
  192. },
  193. computed: {
  194. ...mapState(['storeInfo'])
  195. },
  196. methods: {
  197. loadData() {
  198. uni.showLoading({
  199. title: '加载中'
  200. });
  201. var dateStr = (new Date()).getTime();
  202. var sign = this.getSign('' + this.storeInfo.storeId + dateStr);
  203. this.requst({
  204. url: this.getStoreCouponByIdForStore,
  205. data: {
  206. timestamp: dateStr,
  207. sign: sign,
  208. storeId: this.storeInfo.storeId,
  209. id: this.form.couponId
  210. },
  211. success: res => {
  212. this.form = res.data.obj;
  213. if (this.form.couponFullPrice) {
  214. this.form.couponFullPrice = this.moneyConverter(this.form.couponFullPrice)
  215. }
  216. if (this.form.price) {
  217. this.form.price = this.moneyConverter(this.form.price)
  218. }
  219. if (this.form.startDate) {
  220. this.form.startDate = this.formatDate(this.form.startDate,'yyyy-M-d')
  221. }
  222. if (this.form.endDate) {
  223. this.form.endDate = this.formatDate(this.form.endDate,'yyyy-M-d')
  224. }
  225. if (this.form.goodsId) {
  226. let goods = {
  227. goodsId: this.form.goodsId,
  228. goodsName: this.form.goodsName,
  229. pictureUrl: this.form.pictureUrl
  230. }
  231. this.goodsList.push(goods)
  232. }
  233. console.log(this.goodsList)
  234. uni.hideLoading();
  235. },
  236. fail: (e) => {
  237. console.log("接口调用失败:" + JSON.stringify(e));
  238. uni.hideLoading();
  239. },
  240. })
  241. },
  242. handCheckGoodsType () {
  243. this.$refs.popupPickerView.show()
  244. },
  245. pushGoods() {
  246. this.updateStatusVisible = false
  247. },
  248. handEditGoods (goods, index) {
  249. const params = encodeURIComponent(JSON.stringify(goods));
  250. uni.navigateTo({
  251. url: `/pages/activity/add-coupon-goods?goods=${params}&index=${index}`
  252. })
  253. },
  254. handAddGoods() {
  255. if (this.goodsList.length > 0) {
  256. const ids = this.goodsList.map(item => item.goodsId);
  257. const idsStr = ids.join(',');
  258. const params = encodeURIComponent(JSON.stringify(idsStr));
  259. uni.navigateTo({
  260. url: `/pages/activity/add-coupon-goods?idsStr=${params}`
  261. })
  262. } else {
  263. uni.navigateTo({
  264. url: `/pages/activity/add-coupon-goods`
  265. })
  266. }
  267. },
  268. // 新增图片
  269. async afterRead(event) {
  270. this.event = event
  271. this.file = event.file
  272. let file1 = event.file
  273. let fileListLen = this.fileList.length
  274. // lists.map((item) => {
  275. this.fileList.push({
  276. ...file1,
  277. status: 'success',
  278. // message: '上传中'
  279. })
  280. this.form.imgUrl = this.file.url
  281. },
  282. // 删除图片
  283. deletePic(event) {
  284. this.fileList.splice(event.index, 1)
  285. this.form.imgUrl = ''
  286. },
  287. selectDate() {
  288. this.$refs.calendar.open();
  289. },
  290. changeDiscountType(e) {
  291. console.log("e:", e);
  292. this.form.discountType = e
  293. },
  294. changeUseScopeMember(e) {
  295. console.log("e:", e);
  296. this.form.useScopeMember = e
  297. },
  298. changeStatus (e) {
  299. if (e.detail.value){
  300. this.form.status = 1
  301. } else {
  302. this.form.status = 0
  303. }
  304. },
  305. confirm(e) {
  306. this.form.startDate = e.range.before;
  307. this.form.endDate = e.range.after;
  308. },
  309. save () {
  310. if (this.form.discountType === 1) {
  311. this.form.couponDiscount = ''
  312. }
  313. if (this.form.discountType !== 1) {
  314. this.form.couponFullPrice = ''
  315. }
  316. if (this.form.discountType !== 3){
  317. this.form.couponDiscount = '';
  318. }
  319. if (this.form.discountType === 3 || this.form.discountType === 4){
  320. this.form.price = '';
  321. }
  322. if (this.form.couponFullPrice === null){
  323. this.form.couponFullPrice = '';
  324. }
  325. if (this.form.couponName === '' || !this.form.couponName) {
  326. this.$api.msg('请输入优惠券标题');
  327. return;
  328. }
  329. if (this.form.couponTitle === '' || !this.form.couponTitle) {
  330. this.$api.msg('请输入优惠券子标题');
  331. return;
  332. }
  333. if (this.form.discountType === '' || !this.form.discountType) {
  334. this.$api.msg('请选择优惠类型');
  335. return;
  336. }
  337. if (this.form.discountType === 3) {
  338. if (this.form.couponDiscount === '' && !this.form.couponDiscount) {
  339. this.$api.msg('请输入折扣');
  340. return;
  341. }
  342. }
  343. if (this.form.discountType === 1) {
  344. if (this.form.couponFullPrice === '' && !this.form.couponFullPrice) {
  345. this.$api.msg('请输入满减标准金额');
  346. return;
  347. }
  348. }
  349. if (this.form.discountType !== 3 && this.form.discountType !== 4){
  350. if (this.form.price === '' || !this.form.price) {
  351. this.$api.msg('请输入面额');
  352. return;
  353. }
  354. }
  355. if (this.form.useScopeMember === '' || !this.form.useScopeMember) {
  356. this.$api.msg('请选择可领取人群');
  357. return;
  358. }
  359. if (!this.form.startDate || !this.form.endDate) {
  360. this.$api.msg("请选择活动时间范围");
  361. return;
  362. }
  363. let start = new Date(this.form.startDate)
  364. let end = new Date(this.form.endDate)
  365. let startDates = this.formatDate(this.form.startDate,'yyyy-M-d H:m:s')
  366. let endDates = this.formatDate(this.form.endDate,'yyyy-M-d H:m:s')
  367. if (start > end) {
  368. this.$api.msg("开始时间不能大于结束时间");
  369. return;
  370. }
  371. if (end < new Date() && this.form.status === 1) {
  372. this.$api.msg('优惠券结束时间小于当前时间,无法上架,请先修改时间');
  373. return;
  374. }
  375. if (this.form.publishNum === '' || !this.form.publishNum) {
  376. this.$api.msg('请输入发行数量');
  377. return;
  378. }
  379. if (this.form.couponType === 2) {
  380. if (this.form.discountType === 4) {
  381. if (this.goodsList.length == 0) {
  382. this.$api.msg('请请选择商品');
  383. return;
  384. } else {
  385. this.form.goodsId = this.goodsList[0].goodsId
  386. }
  387. }
  388. }
  389. let find = false
  390. let name = ''
  391. for (var i = 0; i < this.goodsList.length; i++) {
  392. for (var j = i + 1; j < this.goodsList.length; j++) {
  393. if (this.goodsList[i].goodsId == this.goodsList[j].goodsId && this.goodsList[i].goodsName==this.goodsList[j].goodsName) {
  394. find = true;
  395. name = this.goodsList[i].goodsName;
  396. break;
  397. }
  398. }
  399. if (find) break;
  400. }
  401. if (find) {
  402. this.$api.msg('商品:'+ name + "已存在请勿重复添加");
  403. return;
  404. }
  405. uni.showLoading({
  406. title: '保存中'
  407. });
  408. let that = this
  409. var dateStr = (new Date()).getTime();
  410. var sign = that.getSign('' + that.storeInfo.storeId + dateStr);
  411. if (that.event.file) {
  412. return new Promise((resolve, reject) => {
  413. let a = uni.uploadFile({
  414. url: that.storeInfo.code + this.saveUrl,
  415. filePath: that.form.imgUrl,
  416. name: 'file',
  417. formData: {
  418. timestamp: dateStr,
  419. sign: sign,
  420. storeId: that.storeInfo.storeId,
  421. storeUserId: that.storeInfo.storeUserId,
  422. couponId: that.form.couponId,
  423. couponName: that.form.couponName,
  424. couponTitle: that.form.couponTitle,
  425. couponType: that.form.couponType,
  426. discountType: that.form.discountType,
  427. couponFullPrice: that.form.couponFullPrice ? this.form.couponFullPrice * 100 : this.form.couponFullPrice,
  428. imgUrl: that.form.imgUrl,
  429. goodsId: that.form.goodsId,
  430. useScopeMember: that.form.useScopeMember,
  431. startDate: startDates,
  432. endDate: endDates,
  433. goodsId: that.form.goodsId,
  434. publishNum: that.form.publishNum,
  435. status: that.form.status,
  436. price: that.form.price ? this.form.price * 100 : this.form.price,
  437. rmk: that.form.remark || '',
  438. },
  439. header: {
  440. 'content-type': 'multipart/form-data'
  441. }, // header 值
  442. success: (res) => {
  443. if(res.data) {
  444. let data = JSON.parse(res.data)
  445. if (data.rtnBean.rtnCode == 0) {
  446. uni.hideLoading();
  447. uni.showToast({
  448. title: "保存成功",
  449. duration: 3000,
  450. icon: 'none',
  451. });
  452. var pages = getCurrentPages();
  453. var prevPage = pages[pages.length - 2]; //上一个页面
  454. prevPage.$vm.loadData()
  455. uni.navigateBack();
  456. // return;
  457. } else {
  458. uni.hideLoading();
  459. if (data.rtnBean.rtnMsg != '') {
  460. that.$api.msg(data.rtnBean.rtnMsg);
  461. }
  462. }
  463. } else {
  464. uni.hideLoading();
  465. that.$api.msg('优惠券更新失败,请稍后重试');
  466. }
  467. },
  468. fail: (res) => {
  469. uni.hideLoading();
  470. }
  471. });
  472. })
  473. } else {
  474. that.requst({
  475. url: that.saveUrl,
  476. data: {
  477. timestamp: dateStr,
  478. sign: sign,
  479. storeId: that.storeInfo.storeId,
  480. storeUserId: that.storeInfo.storeUserId,
  481. couponId: that.form.couponId,
  482. couponName: that.form.couponName,
  483. couponTitle: that.form.couponTitle,
  484. couponType: that.form.couponType,
  485. discountType: that.form.discountType,
  486. couponFullPrice: that.form.couponFullPrice ? this.form.couponFullPrice * 100 : this.form.couponFullPrice,
  487. imgUrl: that.form.imgUrl,
  488. goodsId: that.form.goodsId,
  489. useScopeMember: that.form.useScopeMember,
  490. startDate: startDates,
  491. endDate: endDates,
  492. goodsId: that.form.goodsId,
  493. publishNum: that.form.publishNum,
  494. status: that.form.status,
  495. price: that.form.price ? this.form.price * 100 : this.form.price,
  496. rmk: that.form.remark || ''
  497. },
  498. success: res => {
  499. if (res.data.rtnBean.rtnCode == 0) {
  500. uni.hideLoading();
  501. uni.showToast({
  502. title: "保存成功",
  503. duration: 3000,
  504. icon: 'none',
  505. });
  506. var pages = getCurrentPages();
  507. var prevPage = pages[pages.length - 2]; //上一个页面
  508. prevPage.$vm.loadData()
  509. uni.navigateBack();
  510. // return;
  511. } else {
  512. uni.hideLoading();
  513. if (res.data.rtnBean.rtnMsg != '') {
  514. that.$api.msg(res.data.rtnBean.rtnMsg);
  515. }
  516. }
  517. },
  518. fail: (e) => {
  519. that.isDisable = false;
  520. console.log("接口调用失败:" + JSON.stringify(e));
  521. uni.hideLoading();
  522. },
  523. });
  524. }
  525. this.requst({
  526. url: this.saveStoreSpecialActivityUrl,
  527. data: {
  528. timestamp: dateStr,
  529. sign: sign,
  530. storeId: this.storeInfo.storeId,
  531. storeSpecialActivityId: this.form.storeSpecialActivityId,
  532. activityName: this.form.activityName,
  533. activityComment: this.form.activityComment,
  534. startDate: this.form.startDate,
  535. endDate: this.form.endDate,
  536. goodsListStr: JSON.stringify(this.goodsList)
  537. },
  538. success: res => {
  539. if (res.data.rtnBean.rtnCode == 0) {
  540. uni.hideLoading();
  541. uni.showToast({
  542. title: "保存成功",
  543. duration: 3000,
  544. icon: 'none',
  545. });
  546. if (this.addFlag) {
  547. uni.redirectTo({
  548. url: '/pages/activity/special-item-info?id=' + res.data.obj
  549. })
  550. } else {
  551. let pages = getCurrentPages();
  552. let prevpage = pages[pages.length - 2];
  553. prevpage.$vm.loadData();
  554. uni.navigateBack();
  555. }
  556. } else {
  557. uni.hideLoading();
  558. this.$api.msg(res.data.rtnBean.rtnMsg);
  559. }
  560. },
  561. fail: (e) => {
  562. console.log("接口调用失败:" + JSON.stringify(e));
  563. uni.hideLoading();
  564. },
  565. })
  566. },
  567. deleteGoods(index, item) {
  568. let that = this
  569. uni.showModal({
  570. title: '提示',
  571. content: '确定移除该商品吗?',
  572. success: function(res) {
  573. if (res.confirm) {
  574. that.goodsList.splice(index, 1);
  575. }
  576. }
  577. });
  578. },
  579. formatDate(value,args) {
  580. var dt = new Date(value);
  581. if(args == 'yyyy-M-d') {
  582. let year = dt.getFullYear();
  583. let month = dt.getMonth() + 1;
  584. let date = dt.getDate();
  585. return `${year}-${month}-${date}`;
  586. } else if(args == 'yyyy-M-d H:m:s'){
  587. let year = dt.getFullYear();
  588. let month = dt.getMonth() + 1;
  589. let date = dt.getDate();
  590. let hour = dt.getHours();
  591. let minute = dt.getMinutes();
  592. let second = dt.getSeconds();
  593. return `${year}-${month}-${date} ${hour}:${minute}:${second}`;
  594. } else if(args == 'MM.dd') {
  595. let month = (dt.getMonth() + 1).toString().padStart(2,'0');
  596. let date = dt.getDate().toString().padStart(2,'0');
  597. return `${month}.${date}`;
  598. } else {// yyyy-MM-dd HH:mm:ss
  599. let year = dt.getFullYear();
  600. let month = (dt.getMonth() + 1).toString().padStart(2,'0');
  601. let date = dt.getDate().toString().padStart(2,'0');
  602. let hour = dt.getHours().toString().padStart(2,'0');
  603. let minute = dt.getMinutes().toString().padStart(2,'0');
  604. let second = dt.getSeconds().toString().padStart(2,'0');
  605. return `${year}-${month}-${date} ${hour}:${minute}:${second}`;
  606. }
  607. }
  608. },
  609. onShow () {
  610. },
  611. onLoad (options) {
  612. if (options && options.id) {
  613. uni.setNavigationBarTitle({
  614. title:'编辑优惠券'
  615. });
  616. this.form.couponId = options.id;
  617. this.loadData();
  618. this.addFlag = false;
  619. } else {
  620. uni.setNavigationBarTitle({
  621. title:'新增优惠券'
  622. })
  623. this.addFlag = true;
  624. }
  625. }
  626. }
  627. </script>
  628. <style lang="scss" scoped>
  629. .required {
  630. color: red;
  631. margin-left: 5px;
  632. }
  633. .special-item-edit-page {
  634. background-color: #f5f5f5;
  635. border-top: 2rpx solid #f5f5f5;
  636. width: 100vw;
  637. height: 100vh;
  638. }
  639. .scroll-content {
  640. height: calc(100vh - 120rpx - env(safe-area-inset-bottom));
  641. height: calc(100vh - 120rpx - constant(safe-area-inset-bottom));
  642. }
  643. .between {
  644. @include between;
  645. }
  646. .cell-wrap {
  647. width: 100vw;
  648. padding: 0 40rpx;
  649. box-sizing: border-box;
  650. background-color: #fff;
  651. }
  652. .item {
  653. @include between;
  654. height: 100rpx;
  655. background-color: #fff;
  656. border-bottom: 2rpx solid #ececec;
  657. font-size: $font-base;
  658. .label {
  659. width: 200rpx;
  660. color: $title-color;
  661. }
  662. .value {
  663. width: calc(100% - 200rpx);
  664. color: $desc-color;
  665. text-align: right;
  666. }
  667. }
  668. .item.dubble {
  669. height: 200rpx;
  670. }
  671. .activities-title {
  672. height: 80rpx;
  673. @include flexStart;
  674. padding: 20rpx 40rpx 0;
  675. box-sizing: border-box;
  676. font-size: $font-base;
  677. color: $title-color;
  678. }
  679. .goods-list {
  680. .goods {
  681. background-color: #fff;
  682. @include flexStart;
  683. padding: 20rpx;
  684. box-sizing: border-box;
  685. margin-bottom: 20rpx;
  686. width: 100%;
  687. .cover {
  688. width: 166rpx;
  689. height: 166rpx;
  690. border-radius: 10rpx;
  691. margin-right: 24rpx;
  692. .img {
  693. width: 166rpx;
  694. height: 166rpx;
  695. }
  696. }
  697. .cont {
  698. width: calc(100% - 200rpx);
  699. font-size: $font-base;
  700. height: 166rpx;
  701. overflow: hidden;
  702. }
  703. .name {
  704. width: 100%;
  705. text-overflow: -o-ellipsis-lastline;
  706. overflow: hidden;
  707. text-overflow: ellipsis;
  708. display: -webkit-box;
  709. -webkit-line-clamp: 2;
  710. -webkit-box-orient: vertical;
  711. }
  712. .tools {
  713. @include flexStart;
  714. }
  715. .price {
  716. margin-right: 40rpx;
  717. color: $uni-color-button;
  718. }
  719. .origin-price {
  720. color: $desc-color;
  721. }
  722. .desc {
  723. color: $desc-color;
  724. }
  725. }
  726. .add-goods {
  727. margin-top: 40rpx;
  728. width: 180rpx;
  729. height: 60rpx;
  730. border: 2rpx solid $theme-color;
  731. color: $theme-color;
  732. @include flexCenter;
  733. margin-left: 40rpx;
  734. }
  735. }
  736. .update-events {
  737. width: 100vw;
  738. @include flexCenter;
  739. margin-top: 40rpx;
  740. .btn {
  741. width: 80vw;
  742. height: 80rpx;
  743. border-radius: 40rpx;
  744. background-color: $theme-color;
  745. color: #fff;
  746. @include flexCenter;
  747. }
  748. }
  749. </style>