confirm-order.php 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <style>
  2. #app{
  3. background-color: #ffffff;
  4. }
  5. .order_steps{
  6. padding: 30px;
  7. width: 50%;
  8. margin: 0 auto;
  9. clear: both;
  10. }
  11. .order_steps .el-step__title{
  12. font-size: small;
  13. font-weight: initial;
  14. }
  15. .el-step__icon{
  16. font-size: small;
  17. font-weight: initial;
  18. }
  19. .el-table__header thead tr th{
  20. background-color: rgb(242 242 242);
  21. height: 40px;
  22. line-height: 40px;
  23. }
  24. .title{
  25. height: 40px;
  26. line-height: 40px;
  27. background-color: #fff;
  28. color: #999999;
  29. font-size: 18px;
  30. padding: 9px 0 1px 40px;
  31. }
  32. /*头像样式 start*/
  33. .default-avatar{
  34. width: 50px;
  35. height: 50px;
  36. border-radius: 50%;
  37. }
  38. .user_img{
  39. position: relative;
  40. margin-right: 8px;
  41. }
  42. .el-table_1_column_1 .cell { /*-2 表示在第二行*/
  43. display: flex;
  44. }
  45. .order_left{width: 50%; padding: 20px; float: left; }
  46. .order_right{width: 50%; padding-right: 40px; margin-top: 20px; text-align: right; float: right;}
  47. /*头像样式 end*/
  48. .line_5{
  49. width: 100%;
  50. height: 5px;
  51. clear: both;
  52. background-color: #f2f2f2
  53. }
  54. .on_open{
  55. width: 100%;
  56. line-height: 200px;
  57. text-align: center;
  58. color: #999;
  59. font-size: 25px;
  60. }
  61. </style>
  62. <div id="app" v-cloak>
  63. <div class="order_steps">
  64. <el-steps :active="active" finish-status="success">
  65. <el-step title="提交订单"></el-step>
  66. <el-step title="支付订单"></el-step>
  67. <el-step title="订单结果"></el-step>
  68. </el-steps>
  69. </div>
  70. <div class="line_5"></div>
  71. <div v-if="addons.mall_name">
  72. <div class="title">购买店铺:{{addons.mall_name}}</div>
  73. <div class="table-body">
  74. <el-table :data="tableData" style="width: 100%; padding: 0 20px 20px 20px;" >
  75. <el-table-column label="应用名称" width="500">
  76. <div class="user_img">
  77. <com-image width="80" height="80" :src="addons.cover ? addons.cover : addons.default_cover" fit="contain"></com-image>
  78. </div>
  79. <div>
  80. <div style="color:#000; padding: 10px 0 5px 0; font-size: 20px;">{{addons.title}}</div>
  81. <samp>{{addons.brief_introduction}}</samp>
  82. </div>
  83. </el-table-column>
  84. <el-table-column label="周期" >
  85. <div v-if="setting.duration == '-1'">
  86. {{unit[setting.unit]}}
  87. </div>
  88. <div v-else>
  89. {{setting.duration}}{{unit[setting.unit]}}
  90. </div>
  91. </el-table-column>
  92. <el-table-column label="单价">
  93. <template slot-scope="scope">
  94. ¥{{setting.money}}
  95. </template>
  96. </el-table-column>
  97. <el-table-column label="数量">x1</el-table-column>
  98. <el-table-column label="小计">
  99. <template slot-scope="scope">
  100. ¥{{setting.money}}
  101. </template>
  102. </el-table-column>
  103. </el-table>
  104. </div>
  105. <div>
  106. <div class="order_left">
  107. <el-checkbox v-model="checked" value="1">我已阅读并同意 </el-checkbox><span @click="payagreement_show = true" style="color: rgb(46, 143, 244); cursor: pointer;" id="cache2">《服务协议》</span>
  108. </div>
  109. <div class="order_right">
  110. <div id="u7497_text" class="text ">
  111. <p style="font-size:13px; padding-bottom: 30px;">
  112. <span>实际付款:</span>
  113. <span style="font-size:18px;color:#E82F2F;">¥{{setting.money}}</span>
  114. </p>
  115. </div>
  116. <el-button type="primary" :loading="loading" @click="saveAddForm()">提交订单</el-button>
  117. </div>
  118. </div>
  119. </div>
  120. <div v-else class="on_open">
  121. 该应用未开放购买
  122. </div>
  123. <el-dialog title="服务协议" :visible.sync="payagreement_show" width="50%" :close-on-click-modal="false">
  124. <div flex="dir:left main:center" class="app-share" >
  125. <div v-html="addons.payagreement"></div>
  126. </div>
  127. <div slot="footer" class="dialog-footer">
  128. <el-button @click="payagreement_show = false" type="primary">关闭</el-button>
  129. </div>
  130. </el-dialog>
  131. </div>
  132. <script>
  133. new Vue({
  134. el: '#app',
  135. data() {
  136. return {
  137. unit:['永久','月','年'],
  138. loading: false,
  139. btnLoading:false,
  140. active: 1,
  141. type:1,
  142. name:'',
  143. checked:0,
  144. price_setting: {},
  145. setting: {},
  146. addons:{},
  147. pay_data: {},
  148. payagreement_show:false,
  149. setting_index:0,
  150. tableData: [{
  151. date: '',
  152. name: '',
  153. address: ''
  154. }],
  155. };
  156. },
  157. created() {
  158. this.name = getQuery('name');
  159. this.setting_index = getQuery('setting_index');
  160. this.type = getQuery('type');
  161. this.getList();
  162. },
  163. methods: {
  164. getList() {
  165. this.loading = true;
  166. request({
  167. params: {
  168. r: 'mall/addons/confirm-order',
  169. name:this.name,
  170. setting_index:this.setting_index,
  171. },
  172. method: 'get',
  173. }).then(e => {
  174. this.loading = false;
  175. if (e.data.code === 0) {
  176. this.addons = e.data.data
  177. this.setting = this.addons.price_setting[this.setting_index];
  178. this.addons.default_cover = _diy_img_prefix+'/static/addons/icon/'+this.addons.name+'.png';
  179. //this.price_setting = this.addons.price_setting;
  180. console.log(this.addons,99);
  181. } else {
  182. this.$message.error(e.data.msg);
  183. }
  184. }).catch(e => {
  185. });
  186. },
  187. saveAddForm(){
  188. if(this.checked != 1){
  189. this.$message.error("请同意服务协议");
  190. return;
  191. }
  192. this.loading = true;
  193. //navigateTo({r: 'mall/addons/confirm-pay',order_id:229});//确认支付
  194. request({
  195. params: {
  196. r: 'mall/addons/create-order'
  197. },
  198. method: 'post',
  199. data:{name:this.name,setting_index:this.setting_index}
  200. }).then(e => {
  201. this.loading = false;
  202. if (e.data.code === 0) {
  203. this.pay_data = e.data.data;
  204. if(this.setting.money == 0){
  205. navigateTo({r: 'mall/addons/confirm-success',order_id:this.pay_data.order.order_id});//确认支付
  206. }else{
  207. navigateTo({r: 'mall/addons/confirm-pay',order_id:this.pay_data.order.order_id});//确认支付
  208. }
  209. } else {
  210. this.$message.error(e.data.msg);
  211. }
  212. }).catch(e => {
  213. this.$message.error(e.data.msg);
  214. });
  215. },
  216. }
  217. });
  218. </script>