|
|
@@ -1,19 +1,371 @@
|
|
|
<template>
|
|
|
<view class="affirm-page">
|
|
|
- <view class="affirm-view"> </view>
|
|
|
+ <view class="affirm-view overscroll">
|
|
|
+ <!-- 门店信息 -->
|
|
|
+ <form>
|
|
|
+ <view class="module-com">
|
|
|
+ <view class="commodity-view">
|
|
|
+ <view class="commodity-list">
|
|
|
+ <view class="commodity-item">
|
|
|
+ <image
|
|
|
+ class="item-icon"
|
|
|
+ src="https://img.huaml.com/uploads/12358/202005/29/de74c55596d304b85e79154958e8bf57_small.jpeg"
|
|
|
+ alt="商品图"
|
|
|
+ />
|
|
|
+
|
|
|
+ <view class="item-info">
|
|
|
+ <view class="info-line">
|
|
|
+ <text class="item-name">天使面孔</text>
|
|
|
+ <text class="item-price">
|
|
|
+ <text class="unit">¥</text>
|
|
|
+
|
|
|
+ <text class="price">60.00</text>
|
|
|
+ </text>
|
|
|
+ </view>
|
|
|
+ <view class="info-line">
|
|
|
+ <text class="item-type">c级</text>
|
|
|
+ <text class="item-count">25/4</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="summary-bar">
|
|
|
+ <view class="operate-view">
|
|
|
+ <text class="iconfont icongouwuche"></text>
|
|
|
+ 重选花材
|
|
|
+ </view>
|
|
|
+ <view class="describe-view">
|
|
|
+ 共3种, 共16扎9支,合计 ¥<text class="price">114.00</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <!-- <view class="prompt-text">注: 请先关注公众号,绑定后可以在移动端自动登录</view> -->
|
|
|
+ <!-- 登录信息 -->
|
|
|
+ <view class="module-com input-line-wrap">
|
|
|
+ <tui-list-cell
|
|
|
+ class="line-cell"
|
|
|
+ :hover="false"
|
|
|
+ :arrow="true"
|
|
|
+ @click="openAddres"
|
|
|
+ >
|
|
|
+ <view class="tui-title ">客户</view>
|
|
|
+ <view class="tui-input" v-if="form.province || form.city">
|
|
|
+ {{ form.province + "-" + form.city }}
|
|
|
+ </view>
|
|
|
+ <view class="tui-placeholder" v-else>请选择客户</view>
|
|
|
+ <input v-model="form.province" name="province" hidden />
|
|
|
+ </tui-list-cell>
|
|
|
+ <tui-list-cell
|
|
|
+ class="line-cell"
|
|
|
+ :hover="false"
|
|
|
+ :arrow="true"
|
|
|
+ @click="openAddres"
|
|
|
+ >
|
|
|
+ <view class="tui-title ">仓库</view>
|
|
|
+ <view class="tui-input" v-if="form.province || form.city">
|
|
|
+ {{ form.province + "-" + form.city }}
|
|
|
+ </view>
|
|
|
+ <view class="tui-placeholder" v-else>请选择仓库</view>
|
|
|
+ <input v-model="form.province" name="province" hidden />
|
|
|
+ </tui-list-cell>
|
|
|
+ <tui-list-cell
|
|
|
+ class="line-cell"
|
|
|
+ :hover="false"
|
|
|
+ :arrow="true"
|
|
|
+ @click="openAddres"
|
|
|
+ >
|
|
|
+ <view class="tui-title ">发货日期</view>
|
|
|
+ <view class="tui-input" v-if="form.province || form.city">
|
|
|
+ {{ form.province + "-" + form.city }}
|
|
|
+ </view>
|
|
|
+ <view class="tui-placeholder" v-else>请选择</view>
|
|
|
+ <input v-model="form.province" name="province" hidden />
|
|
|
+ </tui-list-cell>
|
|
|
+ <tui-list-cell
|
|
|
+ class="line-cell"
|
|
|
+ :hover="false"
|
|
|
+ :arrow="false"
|
|
|
+ @click="openAddres"
|
|
|
+ >
|
|
|
+ <view class="tui-title ">配送方式</view>
|
|
|
+ </tui-list-cell>
|
|
|
+ <!-- <tui-list-cell class="line-cell" :hover="false">
|
|
|
+ <view class="tui-title ">联系电话</view>
|
|
|
+ <input
|
|
|
+ v-model="form.telephone"
|
|
|
+ placeholder-class="phcolor"
|
|
|
+ class="tui-input"
|
|
|
+ name="telephone"
|
|
|
+ placeholder="请输入联系电话"
|
|
|
+ maxlength="50"
|
|
|
+ type="text"
|
|
|
+ />
|
|
|
+ </tui-list-cell> -->
|
|
|
+ <tui-list-cell
|
|
|
+ class="line-cell"
|
|
|
+ :hover="false"
|
|
|
+ :arrow="true"
|
|
|
+ @click="openAddres"
|
|
|
+ >
|
|
|
+ <view class="tui-title ">配送方</view>
|
|
|
+ <view class="tui-input" v-if="form.province || form.city">
|
|
|
+ {{ form.province + "-" + form.city }}
|
|
|
+ </view>
|
|
|
+ <view class="tui-placeholder" v-else>请选择仓库</view>
|
|
|
+ <input v-model="form.province" name="province" hidden />
|
|
|
+ </tui-list-cell>
|
|
|
+ <tui-list-cell
|
|
|
+ class="line-cell"
|
|
|
+ :hover="false"
|
|
|
+ :arrow="true"
|
|
|
+ @click="openAddres"
|
|
|
+ >
|
|
|
+ <view class="tui-title ">配送城市</view>
|
|
|
+ <view class="tui-input" v-if="form.province || form.city">
|
|
|
+ {{ form.province + "-" + form.city }}
|
|
|
+ </view>
|
|
|
+ <view class="tui-placeholder" v-else>请选择</view>
|
|
|
+ <input v-model="form.province" name="province" hidden />
|
|
|
+ </tui-list-cell>
|
|
|
+ <tui-list-cell
|
|
|
+ class="line-cell"
|
|
|
+ :hover="false"
|
|
|
+ :arrow="true"
|
|
|
+ @click="selRegionFn"
|
|
|
+ >
|
|
|
+ <view class="tui-title ">地址</view>
|
|
|
+ <view class="tui-input" v-if="form.address">{{ form.address }}</view>
|
|
|
+ <view class="tui-placeholder" v-else>请填写详细地址</view>
|
|
|
+ <input v-model="form.address" name="address" hidden />
|
|
|
+ </tui-list-cell>
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
+ <view class="tui-title ">门牌号</view>
|
|
|
+ <input
|
|
|
+ v-model="form.floor"
|
|
|
+ placeholder-class="phcolor"
|
|
|
+ class="tui-input"
|
|
|
+ name="floor"
|
|
|
+ placeholder="楼号门牌号(选填)"
|
|
|
+ />
|
|
|
+ </tui-list-cell>
|
|
|
+ <tui-list-cell
|
|
|
+ class="line-cell"
|
|
|
+ :hover="false"
|
|
|
+ :arrow="true"
|
|
|
+ @click="openAddres"
|
|
|
+ >
|
|
|
+ <view class="tui-title ">配送时间</view>
|
|
|
+ <view class="tui-input" v-if="form.province || form.city">
|
|
|
+ {{ form.province + "-" + form.city }}
|
|
|
+ </view>
|
|
|
+ <view class="tui-placeholder" v-else>留空默认20分钟后配送</view>
|
|
|
+ <input v-model="form.province" name="province" hidden />
|
|
|
+ </tui-list-cell>
|
|
|
+ <tui-list-cell
|
|
|
+ class="line-cell"
|
|
|
+ :hover="false"
|
|
|
+ :arrow="false"
|
|
|
+ @click="openAddres"
|
|
|
+ >
|
|
|
+ <view class="tui-title ">运费</view>
|
|
|
+ <view class="tui-input" v-if="form.province || form.city">
|
|
|
+ {{ form.province + "-" + form.city }}
|
|
|
+ </view>
|
|
|
+ <view class="tui-placeholder" v-else></view>
|
|
|
+ <input v-model="form.province" name="province" hidden />
|
|
|
+ </tui-list-cell>
|
|
|
+
|
|
|
+ <!-- <tui-list-cell class="line-cell remark-wrap" :hover="false">
|
|
|
+ <view class="tui-title">简介</view>
|
|
|
+ <view class="tui-input">
|
|
|
+ <textarea
|
|
|
+ v-model="form.introduction"
|
|
|
+ class="tui-textarea remark"
|
|
|
+ placeholder-class="phcolor"
|
|
|
+ placeholder="请输入简介"
|
|
|
+ />
|
|
|
+ </view>
|
|
|
+ </tui-list-cell> -->
|
|
|
+ </view>
|
|
|
+ </form>
|
|
|
+ </view>
|
|
|
<view class="under-bar">
|
|
|
<view class="price-view">
|
|
|
<text class="price-title">收款</text>
|
|
|
<text class="price-number">¥ <text class="large">114</text>.00</text>
|
|
|
</view>
|
|
|
- <button class="admin-button-com blue middle">下单</button>
|
|
|
+ <button class="admin-button-com blue middle" @click="formSubmit">
|
|
|
+ 下单
|
|
|
+ </button>
|
|
|
</view>
|
|
|
+ <!-- 选择地区 -->
|
|
|
+ <app-area-sel
|
|
|
+ :show.sync="showRegion"
|
|
|
+ @change="changeAreaFn"
|
|
|
+ :city="form.city"
|
|
|
+ />
|
|
|
+ <!-- 省市联动 -->
|
|
|
+ <simple-address
|
|
|
+ ref="simpleAddress"
|
|
|
+ :pickerValueDefault="cityPickerValueDefault"
|
|
|
+ @onConfirm="onCityConfirm"
|
|
|
+ ></simple-address>
|
|
|
+ <!-- 选择地区 -->
|
|
|
+ <AppCustomerSel
|
|
|
+ :show.sync="showCustomer"
|
|
|
+ @change="changeCustomerFn"
|
|
|
+ :city="form.customer"
|
|
|
+ />
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import TuiListCell from "@/components/plugin/list-cell";
|
|
|
+import AppAvatarModule from "@/components/module/app-avatar";
|
|
|
+import SimpleAddress from "@/components/plugin/simple-address";
|
|
|
+import AppAreaSel from "@/components/app-area-sel";
|
|
|
+import AppCustomerSel from "@/components/app-customer-sel";
|
|
|
+const form = require("@/utils/formValidation.js");
|
|
|
export default {
|
|
|
- name: "BillingAffirm" // 开单确认
|
|
|
+ name: "BillingAffirm", // 开单确认
|
|
|
+ components: {
|
|
|
+ TuiListCell,
|
|
|
+ AppAvatarModule,
|
|
|
+ SimpleAddress,
|
|
|
+ AppAreaSel,
|
|
|
+ AppCustomerSel
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ form: {
|
|
|
+ shopName: "",
|
|
|
+ province: "",
|
|
|
+ city: "",
|
|
|
+ address: "",
|
|
|
+ floor: "",
|
|
|
+ openTime: "8:00 - 22:00",
|
|
|
+ introduction: "",
|
|
|
+ telephone: "",
|
|
|
+ customer: ""
|
|
|
+ },
|
|
|
+ // 详细地址
|
|
|
+ showRegion: false,
|
|
|
+ showCustomer: true,
|
|
|
+ region: {
|
|
|
+ lat: 0,
|
|
|
+ long: 0
|
|
|
+ },
|
|
|
+ // 省市联动
|
|
|
+ regionData: [],
|
|
|
+ cityPickerValueDefault: [0, 0]
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ init() {
|
|
|
+ this._getDet();
|
|
|
+ },
|
|
|
+ // api
|
|
|
+ _getDet() {
|
|
|
+ let data = uni.getStorageSync("modifyShopB");
|
|
|
+ if (this.$util.isEmpty(data)) return;
|
|
|
+ Object.keys(this.form).forEach((i, index) => {
|
|
|
+ // if (i != 'password') {
|
|
|
+ this.form[i] = data[i];
|
|
|
+ // }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // option
|
|
|
+ // 选择地址
|
|
|
+ selRegionFn() {
|
|
|
+ if (!this.form.city) {
|
|
|
+ this.$msg("请先选择城市!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ this.showRegion = true;
|
|
|
+ },
|
|
|
+ changeAreaFn(e) {
|
|
|
+ console.log("changeAreaFn", e);
|
|
|
+ this.form.address = e.address;
|
|
|
+ this.region.lat = e.location.lat;
|
|
|
+ this.region.long = e.location.lng;
|
|
|
+ },
|
|
|
+ changeCustomerFn(e) {
|
|
|
+ console.log("changeCustomerFn", e);
|
|
|
+ this.form.address = e.address;
|
|
|
+ this.form.lat = e.location.lat;
|
|
|
+ this.form.long = e.location.lng;
|
|
|
+ },
|
|
|
+ // 省市联动
|
|
|
+ openAddres() {
|
|
|
+ this.$refs.simpleAddress.open();
|
|
|
+ },
|
|
|
+ onCityConfirm(e) {
|
|
|
+ // this.form.receiveAddress = e.label
|
|
|
+ this.form.province = e.provinceName;
|
|
|
+ this.form.city = e.cityName;
|
|
|
+ // this.pickerText = JSON.stringify(e)
|
|
|
+ },
|
|
|
+ confirmFn() {
|
|
|
+ let hostFn = this.option.id ? update : add;
|
|
|
+ if (this.option.id) {
|
|
|
+ this.form.id = this.option.id;
|
|
|
+ }
|
|
|
+ hostFn(this.form).then(res => {
|
|
|
+ let promptText = this.option.id ? "修改成功!" : "添加成功!";
|
|
|
+ this.$msg(promptText);
|
|
|
+ // uni.removeStorageSync("modifyShopB");
|
|
|
+ // setTimeout(() => {
|
|
|
+ // this.$util.pageTo("/admin/shop/list");
|
|
|
+ // }, 1000);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 表单验证
|
|
|
+ formSubmit(e) {
|
|
|
+ // 表单规则
|
|
|
+ let rules = [
|
|
|
+ {
|
|
|
+ name: "shopName",
|
|
|
+ rule: [""],
|
|
|
+ msg: ["请输入名称"]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "openTime",
|
|
|
+ rule: [""],
|
|
|
+ msg: ["请输入营业时间"]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "telephone",
|
|
|
+ rule: [""],
|
|
|
+ msg: ["请输入联系电话"]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "province",
|
|
|
+ rule: [""],
|
|
|
+ msg: ["请选择地址"]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "address",
|
|
|
+ rule: [""],
|
|
|
+ msg: ["请填写详细地址"]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "floor",
|
|
|
+ rule: [""],
|
|
|
+ msg: ["请输入门牌号"]
|
|
|
+ }
|
|
|
+ ];
|
|
|
+ // 进行表单检查
|
|
|
+ let formData = this.form;
|
|
|
+ let checkRes = form.validation(formData, rules);
|
|
|
+ // 验证通过!
|
|
|
+ if (!checkRes) {
|
|
|
+ this.confirmFn();
|
|
|
+ } else {
|
|
|
+ this.$msg(checkRes);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
@@ -23,9 +375,118 @@ export default {
|
|
|
height: 100%;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
+
|
|
|
.affirm-view {
|
|
|
flex: 1;
|
|
|
padding: 20px;
|
|
|
+ background-color: #f0f2f6;
|
|
|
+
|
|
|
+ .commodity-view {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ .commodity-list {
|
|
|
+ padding: 20px;
|
|
|
+ .commodity-item {
|
|
|
+ display: flex;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ .item-icon {
|
|
|
+ flex-shrink: 0;
|
|
|
+ width: 140px;
|
|
|
+ height: 140px;
|
|
|
+ }
|
|
|
+ .item-info {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: center;
|
|
|
+ flex: 1;
|
|
|
+ margin-left: 20px;
|
|
|
+ .info-line {
|
|
|
+ margin-bottom: 20px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: flex-end;
|
|
|
+ .item-name {
|
|
|
+ color: #666;
|
|
|
+ font-size: 28px;
|
|
|
+ }
|
|
|
+ .item-price {
|
|
|
+ color: #333;
|
|
|
+ font-size: 22px;
|
|
|
+ .price {
|
|
|
+ font-size: 32px;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .item-type {
|
|
|
+ color: #999;
|
|
|
+ font-size: 24px;
|
|
|
+ }
|
|
|
+ .item-count {
|
|
|
+ color: #666;
|
|
|
+ font-size: 24px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .summary-bar {
|
|
|
+ padding: 0 20px;
|
|
|
+ height: 90px;
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ border-top: 1px solid #eeeeee;
|
|
|
+ .operate-view {
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ align-items: center;
|
|
|
+ color: #3385ff;
|
|
|
+ font-size: 26px;
|
|
|
+ .iconfont {
|
|
|
+ margin-right: 20px;
|
|
|
+ font-size: 40px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .describe-view {
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ align-items: center;
|
|
|
+ color: #333;
|
|
|
+ font-size: 24px;
|
|
|
+ .price {
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 36px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .module-com {
|
|
|
+ background-color: #fff;
|
|
|
+ margin-bottom: 20px;
|
|
|
+
|
|
|
+ border-radius: 10px;
|
|
|
+ overflow: hidden;
|
|
|
+ .member-wrap {
|
|
|
+ .member-det {
|
|
|
+ font-size: 24px;
|
|
|
+ margin-left: 20px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .remark-wrap {
|
|
|
+ align-items: flex-start;
|
|
|
+ .remark {
|
|
|
+ height: 240px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // .tui-placeholder,
|
|
|
+ // .tui-input {
|
|
|
+ // padding-right: 30px;
|
|
|
+ // width: 100%;
|
|
|
+ // text-align: right;
|
|
|
+ // }
|
|
|
+ }
|
|
|
}
|
|
|
.under-bar {
|
|
|
display: flex;
|
|
|
@@ -34,6 +495,9 @@ export default {
|
|
|
padding: 0 20px;
|
|
|
width: 100%;
|
|
|
height: 100px;
|
|
|
+ background-color: #fff;
|
|
|
+
|
|
|
+ box-shadow: 0px -1px 6px 0px rgba(4, 0, 0, 0.06);
|
|
|
.price-view {
|
|
|
display: flex;
|
|
|
align-items: center;
|