index.php 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. {extend name="public/container"}
  2. {block name="head_top"}
  3. <style>
  4. .layui-input-block button{
  5. border: 1px solid rgba(0,0,0,0.1);
  6. }
  7. .layui-card-body{
  8. padding-left: 10px;
  9. padding-right: 10px;
  10. }
  11. .layui-card-body p.layuiadmin-big-font {
  12. font-size: 36px;
  13. color: #666;
  14. line-height: 36px;
  15. padding: 5px 0 10px;
  16. overflow: hidden;
  17. text-overflow: ellipsis;
  18. word-break: break-all;
  19. white-space: nowrap;
  20. }
  21. .layui-fluid .layui-row . {
  22. position: absolute;
  23. right: 15px;
  24. }
  25. .layuiadmin-badge {
  26. top: 50%;
  27. margin-top: -9px;
  28. color: #01AAED;
  29. }
  30. .layuiadmin-span-color i {
  31. padding-left: 5px;
  32. }
  33. .layui-card.card{
  34. border: 2px solid #F2F2F2;
  35. border-radius: 2%;
  36. }
  37. .layui-card.checkcard{
  38. border: 2px solid #F47822;
  39. border-radius: 5px;
  40. }
  41. .block-rigit button{
  42. width: 100px;
  43. letter-spacing: .5em;
  44. line-height: 28px;
  45. }
  46. .layui-form-item{
  47. margin-bottom: .5rem;
  48. }
  49. .layui-form-item .code {
  50. width: 15rem;
  51. }
  52. .layui-form-item .code img{
  53. width: 100%;
  54. height: 100%;
  55. }
  56. </style>
  57. <script src="{__PLUG_PATH}echarts.common.min.js"></script>
  58. {/block}
  59. {block name="content"}
  60. <div class="layui-fluid" id="app" v-cloak="">
  61. <div class="layui-row layui-col-space15">
  62. <div class="layui-col-sm6 layui-col-md3">
  63. <div class="layui-card">
  64. <div class="layui-card-header">
  65. 短信剩余条数
  66. <span class="layui-badge layuiadmin-badge layui-bg-blue">条</span>
  67. </div>
  68. <div class="layui-card-body">
  69. <p class="layuiadmin-big-font">{{number}}</p>
  70. </div>
  71. </div>
  72. </div>
  73. <div class="layui-col-sm6 layui-col-md3">
  74. <div class="layui-card">
  75. <div class="layui-card-header">
  76. 短信发送总条数
  77. <span class="layui-badge layuiadmin-badge layui-bg-cyan">条</span>
  78. </div>
  79. <div class="layui-card-body">
  80. <p class="layuiadmin-big-font">{{send_total}}</p>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. <div class="layui-row layui-col-space15">
  86. <div class="layui-card">
  87. <div class="layui-card-header">
  88. 选择套餐
  89. </div>
  90. <div class="layui-row">
  91. <div class="layui-card-body layui-col-space10">
  92. <div class="layui-col-sm1 layui-col-md2" v-for="(item,index) in priceList" @click="checkMeal(item,index)">
  93. <div class="layui-card" :class="param == index ? 'checkcard' : 'card'">
  94. <div class="layui-card-body" style="padding: 27px 15px 0;">
  95. <p style="text-align: center;color: #F47822;font-size: 30px;line-height: 30px;">{{ item.num }}条</p>
  96. </div>
  97. <div class="layui-card-header">
  98. <p style="text-align: center;color: #C2C5BE;font-size: 16px;">¥{{ item.price }}</p>
  99. </div>
  100. </div>
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. <div class="layui-row layui-col-space15">
  106. <div class="layui-card" v-show="checked">
  107. <div class="layui-card-header">
  108. 立即支付
  109. </div>
  110. <div class="layui-card-body">
  111. <div class="layui-row">
  112. <form class="layui-form" action="">
  113. <div class="layui-form-item">
  114. <label class="layui-form-label">支付方式:</label>
  115. <div class="layui-input-block">
  116. <button type="button" class="layui-btn" :class="payType == 'weixin'? 'layui-btn-normal' : 'layui-btn-primary'" @click="changeType('weixin')">微信支付</button>
  117. </div>
  118. </div>
  119. <div class="layui-form-item">
  120. <label class="layui-form-label">充值条数:</label>
  121. <div class="layui-input-block">
  122. <span style="font-size: 24px;line-height: 33px;">{{ checked.num }} 条</span>
  123. </div>
  124. </div>
  125. <div class="layui-form-item">
  126. <label class="layui-form-label">支付金额:</label>
  127. <div class="layui-input-block">
  128. <p style="line-height: 33px;font-size: 16px;color: #F47822;">¥{{ checked.price }}</p>
  129. </div>
  130. </div>
  131. <div class="layui-form-item">
  132. <div class="layui-input-block code">
  133. <img :src="code.code_url" alt="">
  134. </div>
  135. <div class="layui-input-block">
  136. <span>
  137. 支付码过期时间:{{code.invalid}}
  138. </span>
  139. </div>
  140. </div>
  141. </form>
  142. </div>
  143. </div>
  144. </div>
  145. </div>
  146. </div>
  147. </div>
  148. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  149. <script>
  150. require(['vue'],function(Vue){
  151. new Vue({
  152. el:"#app",
  153. data:{
  154. number:0,
  155. send_total:0,
  156. option:{},
  157. status:'',
  158. data:'',
  159. title:'全部商品',
  160. myChart:{},
  161. showtime:false,
  162. priceList:[],
  163. checked:false,
  164. param:'',
  165. payType: 'weixin',
  166. code: ''
  167. },
  168. watch:{
  169. "param":function (newVal) {
  170. let that = this;
  171. that.checked = that.priceList[newVal];
  172. that.param = newVal;
  173. that.getCode();
  174. }
  175. },
  176. methods:{
  177. checkMeal:function(item,index){
  178. this.param = index;
  179. },
  180. info:function(){
  181. var that=this;
  182. var index=layList.layer.load(2,{shade: [0.3,'#fff']});
  183. layList.baseGet(layList.Url({a:'number'}),function (res){
  184. layList.layer.close(index);
  185. that.number = res.data.number;
  186. that.send_total = res.data.send_total;
  187. },function (err) {
  188. layList.layer.close(index);
  189. });
  190. },
  191. getLackList:function(){
  192. var that=this;
  193. var index=layList.layer.load(2,{shade: [0.3,'#fff']});
  194. layList.baseGet(layList.Url({a:'price'}),function (res){
  195. layList.layer.close(index);
  196. that.priceList = res.data;
  197. if(that.priceList.length > 0){
  198. that.checked = res.data[0];
  199. that.param = 0;
  200. }
  201. },function (err) {
  202. layList.layer.close(index);
  203. });
  204. },
  205. changeType:function(val){
  206. if(val != this.payType) {
  207. this.payType = val;
  208. this.getCode();
  209. }
  210. },
  211. getCode:function(){
  212. let that = this;let index=layList.layer.load(2,{shade: [0.3,'#fff']});
  213. layList.basePost(layList.Url({a:'pay'}),{payType:that.payType,price:that.checked.price,mealId:that.checked.id},function (res){
  214. layList.layer.close(index);
  215. that.code = res.data;
  216. },function (err) {
  217. layList.layer.close(index);
  218. });
  219. },
  220. },
  221. mounted:function () {
  222. this.info();
  223. this.getLackList();
  224. }
  225. });
  226. })
  227. </script>
  228. {/block}