shipInfo.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. <template>
  2. <view class="affirm-page">
  3. <view class="affirm-view overscroll">
  4. <!-- 门店信息 -->
  5. <form>
  6. <!-- 登录信息 -->
  7. <view class="module-com input-line-wrap">
  8. <appFormSend :form.sync="form" :customId="customId" :orderid="orderId"> </appFormSend>
  9. </view>
  10. </form>
  11. <view class="admin-button-com-box">
  12. <navigator open-type="navigateBack" delta="1" class="admin-button-com blue middle active" >取消</navigator>
  13. <button class="admin-button-com blue middle" @tap="formSubmit">确定</button>
  14. </view>
  15. </view>
  16. <!-- 选择客户 -->
  17. <AppCustomerSel :show.sync="showCustomer" @change="changeCustomerFn" />
  18. </view>
  19. </template>
  20. <script>
  21. import TuiListCell from "@/components/plugin/list-cell";
  22. import AppAvatarModule from "@/components/module/app-avatar";
  23. import SimpleAddress from "@/components/plugin/simple-address";
  24. import AppAreaSel from "@/components/app-area-sel";
  25. import AppCustomerSel from "@/components/app-customer-sel";
  26. import productMins from "@/mixins/product";
  27. import appFormRadioBtn from "@/components/app-formRadio-btn";
  28. import appAddressGroup from "@/components/app-address-group";
  29. import appSendTime from "@/components/app-send-time";
  30. import appFormSend from "@/components/app-form-send1";
  31. const formUtil = require("@/utils/formValidation.js");
  32. import { sendExpressage } from "@/api/order/index";
  33. import { getUserDet } from "@/api/member/index";
  34. import { mapActions, mapGetters } from "vuex";
  35. export default {
  36. name: "BillingAffirm", // 开单确认
  37. components: {
  38. TuiListCell,
  39. AppAvatarModule,
  40. SimpleAddress,
  41. AppAreaSel,
  42. AppCustomerSel,
  43. appFormRadioBtn,
  44. appAddressGroup,
  45. appSendTime,
  46. appFormSend
  47. },
  48. mixins: [productMins],
  49. data() {
  50. return {
  51. customId:'',
  52. orderId:'',
  53. autoLoad: false,
  54. form: {
  55. shopId: "",
  56. shopName: "",
  57. receiveProvince: "",
  58. receiveCity: "",
  59. receiveFloor: "",
  60. receiveAddress: "",
  61. receiveLong: "",
  62. receiveLat: "",
  63. sendType: "3",
  64. sendSide: "2",
  65. sendDate: "",
  66. sendTime: "",
  67. sendCost: "",
  68. customId: "",
  69. product: ""
  70. },
  71. // 详细地址
  72. // showRegion: false,
  73. showCustomer: false
  74. };
  75. },
  76. onLoad(e) {
  77. this.customId = e.id;
  78. this.orderId = e.orderId;
  79. if (!this.getMerchantInfo) {
  80. this.initMerchantInfo().then(data => {
  81. uni.setNavigationBarTitle({
  82. title: data.name
  83. });
  84. });
  85. } else {
  86. uni.setNavigationBarTitle({
  87. title: this.getMerchantInfo.name
  88. });
  89. }
  90. },
  91. computed: {
  92. ...mapGetters(["getMerchantInfo", "getLoginInfo"])
  93. },
  94. methods: {
  95. ...mapActions(["initMerchantInfo"]),
  96. init() {
  97. this._getDet();
  98. },
  99. // api
  100. _getDet() {
  101. let data = uni.getStorageSync("modifyShopB");
  102. if (this.$util.isEmpty(data)) return;
  103. Object.keys(this.form).forEach((i, index) => {
  104. // if (i != 'password') {
  105. this.form[i] = data[i];
  106. // }
  107. });
  108. },
  109. changeCustomerFn(info) {
  110. console.log("changeCustomerFn", info);
  111. this.form.customId = info.id;
  112. this.form.customName = info.name;
  113. },
  114. confirmFn(options) {
  115. console.log(options)
  116. sendExpressage({ id: this.orderId,sendCost:options.sendCost,expressId:options.sendSide,sendTime:options.sendTime }).then(res => {
  117. // this.form.province = res.data.province;
  118. // this.form.city = res.data.city;
  119. // this.$emit("selectAdress", this.form);
  120. // uni.navigateTo({url:'/pagesOrder/ship'});
  121. uni.navigateBack({delta: 1});
  122. })
  123. },
  124. // 表单验证
  125. async formSubmit(e) {
  126. try {
  127. // 表单规则
  128. let rules = [];
  129. // {
  130. // name: "sendTime",
  131. // rule: ["required"],
  132. // msg: ["请输入具体时间"]
  133. // }
  134. // 进行表单检查
  135. let formData = this.form;
  136. if (formData.sendType == "1") {
  137. } else {
  138. let temp = [
  139. {
  140. name: "receiveProvince",
  141. rule: ["required"],
  142. msg: ["请选择地址"]
  143. },
  144. {
  145. name: "receiveAddress",
  146. rule: ["required"],
  147. msg: ["请填写详细地址"]
  148. }
  149. ];
  150. rules = rules.concat(temp);
  151. }
  152. const product = this.selectList.map(ele => {
  153. return { productId: ele.id, bigNum: ele.bigCount, smallNum: ele.smallCount };
  154. });
  155. formData.product = JSON.stringify(product);
  156. if (!this.getMerchantInfo) {
  157. await this.initMerchantInfo();
  158. }
  159. formData.shopId = this.getMerchantInfo.id;
  160. if (this.waySele == 1) {
  161. formData.sendCost = "免运费";
  162. }
  163. console.log(9999, formData);
  164. let checkRes = formUtil.validation(formData, rules);
  165. // 验证通过!
  166. if (!checkRes) {
  167. this.confirmFn(formData);
  168. } else {
  169. this.$msg(checkRes);
  170. }
  171. } catch (error) {
  172. console.log(999999, error);
  173. }
  174. },
  175. gobackEvent() {
  176. uni.navigateBack({
  177. delta: 1
  178. });
  179. }
  180. }
  181. };
  182. </script>
  183. <style lang="scss" scoped>
  184. .affirm-page {
  185. position: relative;
  186. height: 100%;
  187. display: flex;
  188. flex-direction: column;
  189. .affirm-view {
  190. flex: 1;
  191. padding: 20upx;
  192. background-color: #f0f2f6;
  193. .commodity-view {
  194. display: flex;
  195. flex-direction: column;
  196. .commodity-list {
  197. padding: 20upx;
  198. .commodity-item {
  199. display: flex;
  200. margin-bottom: 20upx;
  201. .item-icon {
  202. flex-shrink: 0;
  203. width: 140upx;
  204. height: 140upx;
  205. }
  206. .item-info {
  207. display: flex;
  208. flex-direction: column;
  209. justify-content: center;
  210. flex: 1;
  211. margin-left: 20upx;
  212. .info-line {
  213. margin-bottom: 20upx;
  214. display: flex;
  215. justify-content: space-between;
  216. align-items: flex-end;
  217. .item-name {
  218. color: #666;
  219. font-size: 28upx;
  220. }
  221. .item-price {
  222. color: #333;
  223. font-size: 22upx;
  224. .price {
  225. font-size: 32upx;
  226. font-weight: bold;
  227. }
  228. }
  229. .item-type {
  230. color: #999;
  231. font-size: 24upx;
  232. }
  233. .item-count {
  234. color: #666;
  235. font-size: 24upx;
  236. }
  237. }
  238. }
  239. }
  240. }
  241. .summary-bar {
  242. padding: 0 20upx;
  243. height: 90upx;
  244. display: flex;
  245. align-items: center;
  246. justify-content: space-between;
  247. border-top: 1px solid #eeeeee;
  248. .operate-view {
  249. display: flex;
  250. align-items: center;
  251. color: #3385ff;
  252. font-size: 26upx;
  253. .iconfont {
  254. margin-right: 20upx;
  255. font-size: 40upx;
  256. }
  257. }
  258. .describe-view {
  259. display: flex;
  260. align-items: center;
  261. color: #333;
  262. font-size: 24upx;
  263. .price {
  264. font-weight: bold;
  265. font-size: 36upx;
  266. }
  267. }
  268. }
  269. }
  270. .module-com {
  271. background-color: #fff;
  272. margin-bottom: 20upx;
  273. border-radius: 10upx;
  274. overflow: hidden;
  275. .member-wrap {
  276. .member-det {
  277. font-size: 24upx;
  278. margin-left: 20upx;
  279. }
  280. }
  281. .remark-wrap {
  282. align-items: flex-start;
  283. .remark {
  284. height: 240upx;
  285. }
  286. }
  287. // .tui-placeholder,
  288. // .tui-input {
  289. // padding-right: 30upx;
  290. // width: 100%;
  291. // text-align: right;
  292. // }
  293. }
  294. .admin-button-com-box{
  295. display: flex;
  296. justify-content: space-between;
  297. .admin-button-com{
  298. width: 30%;
  299. display: block;
  300. margin: 0 auto;
  301. &.active{
  302. background: #c4c4c5;
  303. border: 1px solid #c4c4c5;
  304. }
  305. }
  306. }
  307. }
  308. .under-bar {
  309. display: flex;
  310. justify-content: space-between;
  311. align-items: center;
  312. padding: 0 20upx;
  313. width: 100%;
  314. height: 100upx;
  315. background-color: #fff;
  316. box-shadow: 0upx -1px 6upx 0upx rgba(4, 0, 0, 0.06);
  317. .price-view {
  318. display: flex;
  319. align-items: center;
  320. font-size: 24upx;
  321. .price-title {
  322. color: #333;
  323. }
  324. .price-number {
  325. margin: 0 20upx;
  326. color: #ff2842;
  327. .large {
  328. font-size: 40upx;
  329. }
  330. }
  331. }
  332. .admin-button-com {
  333. width: 200upx;
  334. display: block;
  335. margin: 0 auto;
  336. }
  337. }
  338. }
  339. </style>