| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- <template>
- <view>
- <view class="box">
- <view class="title">
- 您的装修报价是:
- </view>
- <view class="price-box">
- <view class="price">
- {{ CNY(price.min, '') }}
- </view>
- <view class="link">
- ~
- </view>
- <view class="price">
- {{ CNY(price.max, '') }}
- </view>
- <view class="unit">
- 元
- </view>
- </view>
- </view>
- <bottomForm submitType="品质服务" :extrajson="extrajson" typemx="装修预算" />
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- extrajson: {},
- price: {
- min: 0,
- max: 0
- },
- sa_storeid: 0
- }
- },
- onLoad(options) {
- console.log("options", options)
- let data = JSON.parse(options.data);
- this.extrajson = data;
- uni.setNavigationBarTitle({
- title: '装修预算'
- });
- const systemInitIsComplete = this.$Http.systemInitIsComplete;
- if (!systemInitIsComplete || typeof systemInitIsComplete == 'object') {
- this.$Http.HomePageStartRendering = render(this)
- } else {
- render(this)
- }
- function render(that) {
- that.calculate(options.sa_storeid || uni.getStorageSync('shop').sa_storeid)
- }
- },
- methods: {
- calculate(sa_storeid) {
- this.$Http.basic({
- "id": 20240515131702,
- "content": {
- sa_storeid
- }
- }).then(res => {
- console.log("获取门店装修预算", res)
- if (this.cutoff(res.msg)) return;
- let extrajson = this.extrajson
- let obj = {
- min: 0,
- max: 0
- }
- res.data.forEach(v => {
- switch (v.type) {
- case "厨房":
- obj.min += v.min_price * 6 * extrajson.bathroom[0]
- obj.max += v.max_price * 6 * extrajson.bathroom[0]
- break;
- case "卫浴":
- let num = extrajson.bathroom[2];
- if (num == '>') num = 4;
- obj.min += v.min_price * 4 * num;
- obj.max += v.max_price * 4 * num;
- break;
- case "背景墙":
- let bjq = extrajson.wall[0];
- if (bjq == '>') bjq = 4;
- obj.min += v.min_price * 4 * bjq;
- obj.max += v.max_price * 4 * bjq;
- break;
- }
- })
- this.price = obj;
- this.sa_storeid = sa_storeid;
- console.log(obj)
- })
- },
- getSheraDate() {
- return {
- title: '您的装修报价是:', // 标题
- path: "/store/budget/result?data=" + JSON.stringify(this.extrajson) + '&sa_storeid=' + this.sa_storeid, // 分享路径
- imageUrl: ""// 分享图
- };
- }
- },
- onShareAppMessage(res) {
- return this.getSheraDate()
- },
- onShareTimeline() {
- return this.getSheraDate()
- }
- }
- </script>
- <style lang="scss" scoped>
- .box {
- width: 100vw;
- padding: 30px 20px;
- box-sizing: border-box;
- background: radial-gradient(100% 0% at 50% 50%, #7E7E7E 0%, #787878 100%);
- .title {
- line-height: 22px;
- font-family: PingFang SC, PingFang SC;
- font-size: 16px;
- color: #FFFFFF;
- }
- .price-box {
- display: flex;
- width: 100%;
- margin-top: 15px;
- align-items: center;
- .price {
- width: 146px;
- height: 45px;
- line-height: 45px;
- text-align: center;
- box-sizing: border-box;
- background: rgba(255, 255, 255, 0.2);
- border-radius: 2px;
- border: 1px solid rgba(255, 255, 255, 0.2);
- font-family: Source Han Sans SC, Source Han Sans SC;
- font-weight: bold;
- font-size: 24px;
- color: #FFFFFF;
- }
- .link {
- width: 14px;
- text-align: center;
- font-family: Source Han Sans SC, Source Han Sans SC;
- font-weight: bold;
- font-size: 24px;
- color: #FFFFFF;
- margin: 0 4px;
- margin-right: 6px;
- }
- .unit {
- font-family: PingFang SC, PingFang SC;
- font-size: 14px;
- color: #FFFFFF;
- margin-left: 10px;
- }
- }
- }
- </style>
|