create-recharge-order.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  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. userId:0,
  52. params:{
  53. name:'',
  54. price:'',
  55. note:'',
  56. clubId:0 ,
  57. serviceProviderId:0
  58. }
  59. }
  60. },
  61. onLoad(){
  62. this.initStorage()
  63. },
  64. filters:{
  65. NumFormat(value) {//处理金额
  66. return Number(value).toFixed(2);
  67. },
  68. },
  69. methods: {
  70. async initStorage(){
  71. const culbInfo = await this.$api.getComStorage('orderUserInfo')
  72. const userInfo = await this.$api.getStorage()
  73. this.userId = culbInfo.userID ? culbInfo.userID : 0
  74. this.params.clubId = culbInfo.clubID ? culbInfo.clubID : 0
  75. this.params.serviceProviderId = userInfo.serviceProviderId ? userInfo.serviceProviderId : 0
  76. this.getInitCrearOrder()
  77. },
  78. getInitCrearOrder(option){//协销购物车跳转确认订单初始化信息
  79. this.SellerService.SellerProductRechargeGoods({
  80. productId:6060,
  81. })
  82. .then(response =>{
  83. this.productInfo = response.data
  84. console.log(this.productInfo)
  85. })
  86. .catch(error =>{
  87. this.$util.msg(error.msg,2000)
  88. })
  89. },
  90. orderSubmitMit(){//提交订单
  91. if( this.params.name == ''){
  92. this.$util.msg('请填写商品名称',2000);
  93. return
  94. }
  95. if( this.params.price == ''){
  96. this.$util.msg('请填写商品价格',2000);
  97. return
  98. }
  99. this.SellerService.SellerSubmitRechargeOrder(this.params).then(response =>{
  100. const data = response.data;
  101. this.$util.msg('订单提交成功',2000,true,'success')
  102. setTimeout(()=>{
  103. this.$api.redirectTo(`/pages/seller/order/order-details?type=cash&orderId=${data.orderId}&userId=${this.userId}`)
  104. },2000)
  105. }).catch(error =>{
  106. this.$util.msg(error.msg,2000);
  107. })
  108. },
  109. },
  110. onShow() {
  111. }
  112. }
  113. </script>
  114. <style lang="scss">
  115. page {
  116. height: auto;
  117. background:#F7F7F7;
  118. }
  119. .product-info{
  120. width: 100%;
  121. height: 228rpx;
  122. float: left;
  123. box-sizing: border-box;
  124. padding: 24rpx;
  125. background-color: #ffffff;
  126. .product-logo{
  127. width: 180rpx;
  128. height: 180rpx;
  129. border-radius: 8rpx;
  130. float: left;
  131. image{
  132. width: 180rpx;
  133. height: 180rpx;
  134. display: block;
  135. border-radius: 8rpx;
  136. }
  137. }
  138. .product-cent{
  139. width: 498rpx;
  140. height: 180rpx;
  141. float: right;
  142. .product-name{
  143. width: 100%;
  144. height: 50rpx;
  145. float: left;
  146. line-height: 50rpx;
  147. font-size: $font-size-28;
  148. color: #333333;
  149. text-align: left;
  150. }
  151. .product-note{
  152. width: 100%;
  153. height: 50rpx;
  154. float: left;
  155. line-height: 50rpx;
  156. font-size: $font-size-28;
  157. color: #999999;
  158. text-align: left;
  159. }
  160. .product-nums{
  161. width: 100%;
  162. height: 50rpx;
  163. float: left;
  164. line-height: 50rpx;
  165. font-size: $font-size-28;
  166. color: #333333;
  167. text-align: right;
  168. margin-top: 40rpx;
  169. }
  170. }
  171. }
  172. .created-info{
  173. width: 100%;
  174. height: auto;
  175. box-sizing: border-box;
  176. padding: 24rpx;
  177. background-color: #FFFFFF;
  178. float: left;
  179. .created-item{
  180. width: 100%;
  181. height: 64rpx;
  182. float: left;
  183. margin-bottom: 24rpx;
  184. .label{
  185. width: 148rpx;
  186. height: 64rpx;
  187. line-height: 64rpx;
  188. font-size: $font-size-28;
  189. text-align: left;
  190. color: #666666;
  191. float: left;
  192. }
  193. .input{
  194. width: 550rpx;
  195. height: 64rpx;
  196. box-sizing: border-box;
  197. border: 1px solid #e1e1e1;
  198. padding: 0 20rpx;
  199. line-height: 64rpx;
  200. font-size: $font-size-26;
  201. color: #666666;
  202. float: left;
  203. border-radius: 8rpx;
  204. }
  205. .label-total{
  206. text-align: right;
  207. font-size: $font-size-28;
  208. .red{
  209. color: #f94b4b;
  210. }
  211. }
  212. }
  213. }
  214. .footer{
  215. position: fixed;
  216. left: 0;
  217. bottom: 0;
  218. z-index: 995;
  219. display: flex;
  220. align-items: center;
  221. width: 100%;
  222. height: 110rpx;
  223. line-height: 110rpx;
  224. justify-content: space-between;
  225. font-size: $font-size-28;
  226. background-color: #FFFFFF;
  227. z-index: 998;
  228. color: $text-color;
  229. .footer-le{
  230. width:570rpx;
  231. height:100%;
  232. float: left;
  233. }
  234. .footer-count{
  235. float: left;
  236. padding-left: 24rpx;
  237. width:190rpx;
  238. box-sizing: border-box;
  239. font-size: $font-size-26;
  240. }
  241. .footer-price{
  242. width:370rpx;
  243. float: right;
  244. text-align: right;
  245. color: $text-color;
  246. padding: 10rpx 20rpx 10rpx 0;
  247. box-sizing: border-box;
  248. .sum{
  249. width: 100%;
  250. height: 90rpx;
  251. line-height: 90rpx;
  252. float: left;
  253. .price{
  254. font-size: $font-size-32;
  255. color: #FF2A2A;
  256. }
  257. }
  258. }
  259. .footer-submit{
  260. display:flex;
  261. align-items:center;
  262. justify-content: center;
  263. width: 180rpx;
  264. height: 100%;
  265. box-sizing: border-box;
  266. padding: 15rpx 5rpx;
  267. .btn{
  268. width: 100%;
  269. height: 100%;
  270. color: #FFFFFF;
  271. background:linear-gradient(135deg,rgba(242,143,49,1) 0%,rgba(225,86,22,1) 100%);
  272. font-size: $font-size-26;
  273. text-align: center;
  274. line-height: 80rpx;
  275. border-radius: 40rpx;
  276. }
  277. }
  278. }
  279. </style>