| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321 |
- <template>
- <view class="affirm-page">
- <view class="affirm-view overscroll">
- <!-- 门店信息 -->
- <form>
- <!-- 登录信息 -->
- <view class="module-com input-line-wrap">
- <appFormSend :form.sync="form" :customId="customId" :orderid="orderId"> </appFormSend>
- </view>
- </form>
- <view class="admin-button-com-box">
- <button class="admin-button-com blue big" @tap="formSubmit">确定</button>
- </view>
- </view>
- </view>
- </template>
- <script>
- import TuiListCell from "@/components/plugin/list-cell";
- import appFormSend from "@/components/app-form-send1";
- const formUtil = require("@/utils/formValidation.js");
- import { sendExpressage } from "@/api/order/index";
- import { mapActions, mapGetters } from "vuex";
- export default {
- name: "BillingAffirm", // 开单确认
- components: {
- TuiListCell,
- appFormSend
- },
- // mixins: [productMins],
- data() {
- return {
- customId:'',
- orderId:'',
- autoLoad: false,
- form: {
- shopId: "",
- shopName: "",
- receiveProvince: "",
- receiveCity: "",
- receiveFloor: "",
- receiveAddress: "",
- receiveLong: "",
- receiveLat: "",
- sendType: "3",
- sendSide: "2",
- sendDate: "",
- sendTime: "",
- sendCost: "",
- customId: "",
- product: "",
- remark: "",
- },
- showCustomer: false
- };
- },
- onLoad(e) {
- this.customId = e.id;
- this.orderId = e.orderId;
- if (!this.getMerchantInfo && this.customId != '0') {
- this.initMerchantInfo().then(data => {
- uni.setNavigationBarTitle({title: '确认客户地址'});
- });
- } else {
- uni.setNavigationBarTitle({title: '确认客户地址'});
- }
- },
- computed: {
- ...mapGetters(["getMerchantInfo", "getLoginInfo"])
- },
- methods: {
- ...mapActions(["initMerchantInfo"]),
- init() {
- this._getDet();
- },
- _getDet() {
- let data = uni.getStorageSync("modifyShopB");
- if (this.$util.isEmpty(data)) return;
- Object.keys(this.form).forEach((i, index) => {
- this.form[i] = data[i];
- });
- },
- changeCustomerFn(info) {
- console.log("changeCustomerFn", info);
- this.form.customId = info.id;
- this.form.customName = info.name;
- },
- confirmFn(options) {
- console.log(options)
- sendExpressage({ id: this.orderId,sendCost:options.sendCost,expressId:options.sendSide,sendTime:options.sendTime,remark:options.remark }).then(res => {
- uni.navigateBack({delta: 1});
- })
- },
- // 表单验证
- async formSubmit(e) {
- console.log(this.selectList)
- try {
- // 表单规则
- let rules = [];
- // 进行表单检查
- let formData = this.form;
- if (formData.sendType == "1") {
- } else {
- let temp = [
- {
- name: "receiveProvince",
- rule: ["required"],
- msg: ["请选择地址"]
- },
- {
- name: "receiveAddress",
- rule: ["required"],
- msg: ["请填写详细地址"]
- }
- ];
- rules = rules.concat(temp);
- }
- if(!this.$util.isEmpty(this.selectList)){
- const product = this.selectList.map(ele => {
- return { productId: ele.id, bigNum: ele.bigCount, smallNum: ele.smallCount };
- });
- formData.product = JSON.stringify(product);
- }
- if (!this.getMerchantInfo) {
- await this.initMerchantInfo();
- }
- formData.shopId = this.getMerchantInfo.id;
- if (this.waySele == 1) {
- formData.sendCost = "免运费";
- }
- let checkRes = formUtil.validation(formData, rules);
- console.log(checkRes);
- // 验证通过!
- if (!checkRes) {
- this.confirmFn(formData);
- } else {
- this.$msg(checkRes);
- }
- } catch (error) {
- console.log(999999888, error);
- }
- },
- gobackEvent() {
- uni.navigateBack({
- delta: 1
- });
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .affirm-page {
- position: relative;
- height: 100%;
- display: flex;
- flex-direction: column;
- .affirm-view {
- flex: 1;
- padding: 20upx;
- background-color: #f0f2f6;
- .commodity-view {
- display: flex;
- flex-direction: column;
- .commodity-list {
- padding: 20upx;
- .commodity-item {
- display: flex;
- margin-bottom: 20upx;
- .item-icon {
- flex-shrink: 0;
- width: 140upx;
- height: 140upx;
- }
- .item-info {
- display: flex;
- flex-direction: column;
- justify-content: center;
- flex: 1;
- margin-left: 20upx;
- .info-line {
- margin-bottom: 20upx;
- display: flex;
- justify-content: space-between;
- align-items: flex-end;
- .item-name {
- color: #666;
- font-size: 28upx;
- }
- .item-price {
- color: #333;
- font-size: 22upx;
- .price {
- font-size: 32upx;
- font-weight: bold;
- }
- }
- .item-type {
- color: #999;
- font-size: 24upx;
- }
- .item-count {
- color: #666;
- font-size: 24upx;
- }
- }
- }
- }
- }
- .summary-bar {
- padding: 0 20upx;
- height: 90upx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- border-top: 1upx solid #eeeeee;
- .operate-view {
- display: flex;
- align-items: center;
- color: #3385ff;
- font-size: 26upx;
- .iconfont {
- margin-right: 20upx;
- font-size: 40upx;
- }
- }
- .describe-view {
- display: flex;
- align-items: center;
- color: #333;
- font-size: 24upx;
- .price {
- font-weight: bold;
- font-size: 36upx;
- }
- }
- }
- }
- .module-com {
- background-color: #fff;
- margin-bottom: 20upx;
- border-radius: 10upx;
- overflow: hidden;
- .member-wrap {
- .member-det {
- font-size: 24upx;
- margin-left: 20upx;
- }
- }
- .remark-wrap {
- align-items: flex-start;
- .remark {
- height: 240upx;
- }
- }
- // .tui-placeholder,
- // .tui-input {
- // padding-right: 30upx;
- // width: 100%;
- // text-align: right;
- // }
- }
- .admin-button-com-box{
- display: flex;
- justify-content: space-between;
- .admin-button-com{
- width: 100%;
- display: block;
- margin: 0 auto;
- &.active{
- background: #c4c4c5;
- border: 1upx solid #c4c4c5;
- }
- }
- }
- }
- .under-bar {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 0 20upx;
- width: 100%;
- height: 100upx;
- background-color: #fff;
- box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
- .price-view {
- display: flex;
- align-items: center;
- font-size: 24upx;
- .price-title {
- color: #333;
- }
- .price-number {
- margin: 0 20upx;
- color: #ff2842;
- .large {
- font-size: 40upx;
- }
- }
- }
- .admin-button-com {
- width: 200upx;
- display: block;
- margin: 0 auto;
- }
- }
- }
- </style>
|