123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
- <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
- <title>title</title>
- <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
- <link rel="stylesheet" type="text/css" href="../../css/aui.css"/>
- <link rel="stylesheet" type="text/css" href="../../css/html.css">
- <style>
- body {
- }
- .aui-input-price {
- height: 1.5 rem !important;
- padding-left: 10px !important;
- }
- .aui-checkbox .input_check {
- margin-top: 0px;
- width: 20px;
- height: 20px;
- }
- .aui-checkbox .input_check+ label {
- width: 20px;
- height: 20px;
- }
- </style>
- </head>
- <body>
- <div class="aui-content aui-margin-b-15" id="app">
- <ul class="aui-list aui-list-in">
- <li class="aui-list-item">
- <div class="aui-list-item-inner">
- <div class="aui-list-item-title">
- 服务项目
- </div>
- <div class="aui-list-item-right" v-on:click="chooseService">
- <div class="price-right zmq-bg-noraml zmq-text-white zmq-radius-5">
- <em class="zmq-padding-doneBtn">{{service.name}}</em>
- </div>
- </div>
- </div>
- </li>
- <li class="aui-list-item">
- <div class="aui-list-item-inner">
- <div class="aui-list-item-title">
- 服务价格
- </div>
- <div class="aui-list-item-title">
- <input type="number" placeholder="请完善价格" class="aui-input-price zmq-input-noborder zmq-text-msg zmq-text-font-08" style="text-align: right" v-model="servicePrice" />
- </div>
- </div>
- </li>
- </ul>
- <div class="zmq-footer-fixed zmq-padding-vertical-5" v-on:click="sumbilt">
- <div class="zmq-width-90 zmq-btn-img zmq-padding-vertical-10 zmq-textAlign-center zmq-text-white">
- 提交服务
- </div>
- </div>
- </div>
- </body>
- <script type="text/javascript" src="../../script/api.js"></script>
- <script type="text/javascript" src="../../script/vue.js"></script>
- <script type="text/javascript" src="../../script/httpRequest.js"></script>
- <script type="text/javascript" src="../../script/vue_plugins.js"></script>
- <script type="text/javascript">
- apiready = function() {
- new Vue({
- el : '#app',
- data : {
- retariler_id : '',
- // 用户信息
- userinfo : '',
- // 服务目录
- services : [],
- // 获取轮胎服务
- getServicesUrl : 'getServices',
- service: {
- name : '点击选择服务',
- id : '',
- }, // 选中服务
- servicePrice : '', // 服务价格
- // 选择器
- UIActionSelector : '',
- // 提交服务
- addServicesUrl : 'addServices',
- },
- methods : {
- init : function() {
- this.retariler_id = $api.getStorage("retailerid");
- this.UIActionSelector = api.require('UIActionSelector');
- this.getService1();
- },
- // 获取服务列表
- getService1 : function() {
- var data = {
- }, _this = this;
- this.$get(this.getServicesUrl, data, function(ret) {
- if (ret.code == 0) {
- var list = new Array();
- ret.list.map(function(service,index){
- var option = {
- name : service.serviceName,
- id : service.id
- }
- list.push(option);
- })
- _this.services = list;
- }
- })
- },
- // 点击了选择服务
- chooseService : function(){
- var _this = this;
- this.chooseRegion(this.UIActionSelector, 1, this.services, function(ret) {
- if (ret.eventType == 'ok') {
- _this.service = ret.selectedInfo[0];
- }
- });
- },
- // 提交服务
- sumbilt : function(){
- if(this.service.id == ''){
- api.toast({
- msg:'请选择服务项目'
- });
- return;
- }
- if(this.servicePrice == ''){
- api.toast({
- msg:'请完善服务价格'
- });
- return;
- }
- var data = {
- retailerId : this.retariler_id,
- serviceId : this.service.id,
- serviceName :this.service.name,
- servicePrice : this.servicePrice,
- type : 'body',
- url : 'json'
- },_this = this;
- this.$post(this.addServicesUrl,data,function(ret){
- if(ret.code == 0){
- api.toast({
- msg:'添加服务成功'
- });
- _this.sendEvent("refushService");
- setTimeout(function(){
- api.closeWin({
- });
- },500);
- }
- })
- },
- // 编辑选择这个商品
- chooseThis : function(check, index) {
- var checked = check == true ? false : true;
- this.$set(this.services[index], "checked", checked);
- },
- },
- mounted : function() {
- this.init();
- }
- })
- }
- </script>
- </html>
|