shipInfo.vue 6.5 KB

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