create-recharge-order.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <template>
  2. <view class="container order clearfix" :style="{paddingBottom :isIphoneX ? '170rpx' : '134rpx'}">
  3. <view class="product-info">
  4. <view class="product-logo">
  5. <image :src="productInfo.mainImage" mode=""></image>
  6. </view>
  7. <view class="product-cent">
  8. <view class="product-name">商品编码:{{ productInfo.productCode }}</view>
  9. <view class="product-note">规格:{{ productInfo.unit }}</view>
  10. <view class="product-nums">X1</view>
  11. </view>
  12. </view>
  13. <view class="created-info">
  14. <view class="created-item">
  15. <view class="label">商品名称:</view>
  16. <input class="input" type="text" v-model="params.name" placeholder="必填,最多不超过40个汉字" maxlength="40"/>
  17. </view>
  18. <view class="created-item">
  19. <view class="label">商品价格:</view>
  20. <input class="input" type="number" v-model="params.price" placeholder="必填" maxlength="20"/>
  21. </view>
  22. <view class="created-item">
  23. <view class="label">备注:</view>
  24. <input class="input" type="text" v-model="params.note" placeholder="选填,最多不超过50个汉字" maxlength="50"/>
  25. </view>
  26. <view class="created-item">
  27. <view class="label-total">合计:<text class="red">¥{{params.price | NumFormat}}</text> </view>
  28. </view>
  29. </view>
  30. <view class="footer" :style="{paddingBottom :isIphoneX ? '68rpx' : '0rpx'}">
  31. <view class="footer-le">
  32. <view class="footer-count">
  33. <text>共1件商品</text>
  34. </view>
  35. <view class="footer-price">
  36. <view class="sum">总价:<text class="price">¥{{params.price | NumFormat}}</text></view>
  37. </view>
  38. </view>
  39. <view class="footer-submit" @click.stop="orderSubmitMit">
  40. <view class="btn">提交订单</view>
  41. </view>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. export default {
  47. data() {
  48. return {
  49. isIphoneX:this.$store.state.isIphoneX,
  50. productInfo:{},
  51. params:{
  52. name:'',
  53. price:'',
  54. note:'',
  55. userId:0 ,
  56. serviceProviderId:0
  57. }
  58. }
  59. },
  60. onLoad(option){//商品数据
  61. this.$api.getComStorage('orderUserInfo').then((resolve) =>{
  62. this.params.userId = resolve.userID
  63. this.getInitCrearOrder();
  64. })
  65. },
  66. filters:{
  67. NumFormat(value) {//处理金额
  68. return Number(value).toFixed(2);
  69. },
  70. },
  71. methods: {
  72. getInitCrearOrder(option){//协销购物车跳转确认订单初始化信息
  73. this.$api.getStorage().then((resolve) =>{
  74. this.params.serviceProviderId = resolve.serviceProviderId
  75. this.SellerService.SellerProductRechargeGoods({
  76. productId:6060,
  77. })
  78. .then(response =>{
  79. this.productInfo = response.data
  80. console.log(this.productInfo)
  81. })
  82. .catch(error =>{
  83. this.$util.msg(error.msg,2000)
  84. })
  85. })
  86. },
  87. orderSubmitMit(){//提交订单
  88. if( this.params.name == ''){
  89. this.$util.msg('请填写商品名称',2000);
  90. return
  91. }
  92. if( this.params.price == ''){
  93. this.$util.msg('请填写商品价格',2000);
  94. return
  95. }
  96. this.SellerService.SellerSubmitRechargeOrder({'params':JSON.stringify(this.params)}).then(response =>{
  97. const data = response.data;
  98. if(data.code === '1'){
  99. this.$util.msg('支付成功',2000,true,'success')
  100. setTimeout(() =>{
  101. this.$api.redirectTo(`/pages/seller/order/order-details?type=cash&orderID=${data.orderID}&userId=${this.params.userId}`)
  102. },2000)
  103. }else{
  104. this.$util.msg('订单提交成功',2000,true,'success')
  105. setTimeout(()=>{
  106. this.$api.redirectTo(`/pages/seller/order/order-details?type=cash&orderID=${data.orderID}&userId=${this.params.userId}`)
  107. },2000)
  108. }
  109. }).catch(error =>{
  110. this.$util.msg(error.msg,2000);
  111. })
  112. },
  113. },
  114. onShow() {
  115. }
  116. }
  117. </script>
  118. <style lang="scss">
  119. page {
  120. height: auto;
  121. background:#F7F7F7;
  122. }
  123. .product-info{
  124. width: 100%;
  125. height: 228rpx;
  126. float: left;
  127. box-sizing: border-box;
  128. padding: 24rpx;
  129. background-color: #ffffff;
  130. .product-logo{
  131. width: 180rpx;
  132. height: 180rpx;
  133. border-radius: 8rpx;
  134. float: left;
  135. image{
  136. width: 180rpx;
  137. height: 180rpx;
  138. display: block;
  139. border-radius: 8rpx;
  140. }
  141. }
  142. .product-cent{
  143. width: 498rpx;
  144. height: 180rpx;
  145. float: right;
  146. .product-name{
  147. width: 100%;
  148. height: 50rpx;
  149. float: left;
  150. line-height: 50rpx;
  151. font-size: $font-size-28;
  152. color: #333333;
  153. text-align: left;
  154. }
  155. .product-note{
  156. width: 100%;
  157. height: 50rpx;
  158. float: left;
  159. line-height: 50rpx;
  160. font-size: $font-size-28;
  161. color: #999999;
  162. text-align: left;
  163. }
  164. .product-nums{
  165. width: 100%;
  166. height: 50rpx;
  167. float: left;
  168. line-height: 50rpx;
  169. font-size: $font-size-28;
  170. color: #333333;
  171. text-align: right;
  172. margin-top: 40rpx;
  173. }
  174. }
  175. }
  176. .created-info{
  177. width: 100%;
  178. height: auto;
  179. box-sizing: border-box;
  180. padding: 24rpx;
  181. background-color: #FFFFFF;
  182. float: left;
  183. .created-item{
  184. width: 100%;
  185. height: 64rpx;
  186. float: left;
  187. margin-bottom: 24rpx;
  188. .label{
  189. width: 148rpx;
  190. height: 64rpx;
  191. line-height: 64rpx;
  192. font-size: $font-size-28;
  193. text-align: left;
  194. color: #666666;
  195. float: left;
  196. }
  197. .input{
  198. width: 550rpx;
  199. height: 64rpx;
  200. box-sizing: border-box;
  201. border: 1px solid #e1e1e1;
  202. padding: 0 20rpx;
  203. line-height: 64rpx;
  204. font-size: $font-size-26;
  205. color: #666666;
  206. float: left;
  207. border-radius: 8rpx;
  208. }
  209. .label-total{
  210. text-align: right;
  211. font-size: $font-size-28;
  212. .red{
  213. color: #f94b4b;
  214. }
  215. }
  216. }
  217. }
  218. .footer{
  219. position: fixed;
  220. left: 0;
  221. bottom: 0;
  222. z-index: 995;
  223. display: flex;
  224. align-items: center;
  225. width: 100%;
  226. height: 110rpx;
  227. line-height: 110rpx;
  228. justify-content: space-between;
  229. font-size: $font-size-28;
  230. background-color: #FFFFFF;
  231. z-index: 998;
  232. color: $text-color;
  233. .footer-le{
  234. width:570rpx;
  235. height:100%;
  236. float: left;
  237. }
  238. .footer-count{
  239. float: left;
  240. padding-left: 24rpx;
  241. width:190rpx;
  242. box-sizing: border-box;
  243. font-size: $font-size-26;
  244. }
  245. .footer-price{
  246. width:370rpx;
  247. float: right;
  248. text-align: right;
  249. color: $text-color;
  250. padding: 10rpx 20rpx 10rpx 0;
  251. box-sizing: border-box;
  252. .sum{
  253. width: 100%;
  254. height: 90rpx;
  255. line-height: 90rpx;
  256. float: left;
  257. .price{
  258. font-size: $font-size-32;
  259. color: #FF2A2A;
  260. }
  261. }
  262. }
  263. .footer-submit{
  264. display:flex;
  265. align-items:center;
  266. justify-content: center;
  267. width: 180rpx;
  268. height: 100%;
  269. box-sizing: border-box;
  270. padding: 15rpx 5rpx;
  271. .btn{
  272. width: 100%;
  273. height: 100%;
  274. color: #FFFFFF;
  275. background:linear-gradient(135deg,rgba(242,143,49,1) 0%,rgba(225,86,22,1) 100%);
  276. font-size: $font-size-26;
  277. text-align: center;
  278. line-height: 80rpx;
  279. border-radius: 40rpx;
  280. }
  281. }
  282. }
  283. </style>