sign_address.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <!DOCTYPE html>
  2. <html class="">
  3. <!--STATUS OK-->
  4. <head>
  5. <meta name="referrer" content="always" />
  6. <meta charset='utf-8' />
  7. <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
  8. <meta http-equiv="x-dns-prefetch-control" content="on">
  9. <meta name="description" content="">
  10. <meta name="format-detection" content="telephone=no" />
  11. <link rel="stylesheet" type="text/css" href="../css/api.css" />
  12. <link rel="stylesheet" type="text/css" href="../css/aui-win.css" />
  13. <link rel="stylesheet" type="text/css" href="css/vant-ui.css" />
  14. <link rel="stylesheet" type="text/css" href="css/iconfont.css">
  15. <link rel="stylesheet" type="text/css" href="css/main.css" />
  16. <script type="text/javascript" src="../script/aui-tab.js"></script>
  17. <script src="js/vue.js"></script>
  18. <script src="js/vant-ui.js"></script>
  19. <script src="js/main.js"></script>
  20. <title></title>
  21. </head>
  22. <style>
  23. </style>
  24. <body>
  25. <div id="app" style="background-color:#EDEDED">
  26. <header class="aui-bar aui-bar-nav aui-bar-info" id="aui-header">
  27. <div>
  28. <a class="aui-btn aui-btn-info aui-pull-left" tapmode onclick="closeWin()"> <span
  29. class="aui-iconfont aui-icon-left"></span> </a>
  30. <div class="aui-title" id="aui-title">
  31. 签约地址管理
  32. </div>
  33. <a class="aui-btn aui-btn-info aui-pull-right" tapmode v-on:click="updatesign">确定</a>
  34. </div>
  35. </header>
  36. <div class="card-list">
  37. <van-cell is-link v-on:click="getSignLv" v-if="contractTask==0">{{valueLv}}</van-cell>
  38. <van-cell is-link v-on:click="goMap" v-if="addressModify==0">{{address}}</van-cell>
  39. <van-popup v-model="showPicker" position="bottom" :style="{ height: '30%' }">
  40. <van-picker title="签约等级" show-toolbar v-bind:columns="signList" value-key="signLv"
  41. v-on:cancel="onCancel" v-on:confirm="onConfirm" />
  42. </van-popup>
  43. <div style="background-color: #fff;margin: .2rem;padding: .2rem;border-radius: .2rem;">
  44. 说明:<br>
  45. 1,更改后的签约任务自2020年10月1日起生效,即自10月1日起考核签约任务完成量,2020年10月1日后不允许再次更改签约任务。<br>
  46. 2,修改签约地址后电子围栏即刻生效,2020年10月1日之前您可多次调整门店地址直至合适。2020年10月1日之后不能再更改。<br>
  47. </div>
  48. </div>
  49. </div>
  50. </body>
  51. <link rel="stylesheet" href="./mescroll/mescroll.min.css">
  52. <script type="text/javascript" src="./js/qrcode.min.js"></script>
  53. <script type="text/javascript" src="../script/aui-scroll.js"></script>
  54. <script type="text/javascript" src="./mescroll/mescroll.min.js"></script>
  55. <script type="text/javascript" src="../script/api.js"></script>
  56. <script type="text/javascript" src="../script/httpRequest.js"></script>
  57. <script type="text/javascript" src="../script/vue_plugins.js"></script>
  58. <script type="text/javascript">
  59. function closeWin() {
  60. api.closeWin({});
  61. }
  62. apiready = function () {
  63. var addressModify = api.pageParam.addressModify;
  64. var contractTask = api.pageParam.contractTask
  65. api.parseTapmode();
  66. var header = $api.byId('aui-header');
  67. $api.fixStatusBar(header);
  68. new Vue({
  69. el: '#app',
  70. data: {
  71. showPicker: false,
  72. signList: [],
  73. valueLv: "请选择签约等级",
  74. userDistrct: '',
  75. address: '请选择地址',
  76. addressModify: addressModify,
  77. contractTask: contractTask
  78. },
  79. methods: {
  80. init: function () {
  81. this.storeId = $api.getStorage('userid');
  82. this.SignlvList();
  83. this.getsignAddress();
  84. var _this = this;
  85. this.addEvent('chooseDistict', function (ret) {
  86. if (ret) {
  87. _this.userDistrct = ret.value.p + ret.value.c + ret.value.d;
  88. _this.userAddress = ret.value.a;
  89. _this.userLat = ret.value.lat;
  90. _this.userlon = ret.value.lon;
  91. _this.address = _this.userDistrct + _this.userAddress;
  92. _this.province = ret.value.p
  93. _this.city = ret.value.c
  94. _this.district = ret.value.d
  95. _this.addressInfo = ret.value.a
  96. }
  97. api.closeWin({
  98. name: 'map_win'
  99. });
  100. })
  101. },
  102. onCancel: function () {
  103. this.showPicker = false;
  104. },
  105. getSignLv: function () {
  106. this.showPicker = true;
  107. var url = "getSignLvU",
  108. _this = this;
  109. this.$post(url, {
  110. "status": 0,
  111. url: "json",
  112. type: 'body'
  113. }, function (ret) {
  114. if (ret.code == 0 || ret.code == '0') {
  115. _this.signList = ret.date;
  116. }
  117. })
  118. },
  119. onConfirm: function (value) {
  120. this.valueLv = value.signLv;
  121. this.numTask = value.numTask;
  122. this.showPicker = false;
  123. },
  124. SignlvList:function(){
  125. var _this = this,
  126. url = "SignlvList",
  127. data = {
  128. "STORE_ID": this.storeId,
  129. "IS_DELETE": 0,
  130. "type": 'body',
  131. "url": 'json'
  132. }
  133. this.$post(url, data, function (ret) {
  134. if (ret.code == 0) {
  135. if (ret.list.length != 0) {
  136. _this.valueLv = ret.list[0].signLv;
  137. _this.numTask = ret.list[0].numTask;
  138. if(!_this.valueLv){
  139. _this.valueLv="请选择签约等级"
  140. }
  141. _this.oldvalueLv = ret.list[0].signLv;
  142. }
  143. }
  144. });
  145. },
  146. getsignAddress: function () {
  147. var _this = this,
  148. url = "getsignAddress",
  149. data = {
  150. "STORE_ID": this.storeId,
  151. "IS_DELETE": 0,
  152. "type": 'body',
  153. "url": 'json'
  154. }
  155. this.$post(url, data, function (ret) {
  156. if (ret.code == 0) {
  157. if (ret.list.length != 0) {
  158. _this.address = ret.list[0].province + ret.list[0].city + ret.list[0].district + ret.list[0].addressInfo;
  159. if (!_this.address) {
  160. _this.address="请选择地址"
  161. }
  162. _this.oldaddress = ret.list[0].province + ret.list[0].city + ret.list[0].district + ret.list[0].addressInfo;
  163. var reg = new RegExp("null", "g");
  164. _this.address = _this.address.replace(reg, "")
  165. }
  166. }
  167. });
  168. },
  169. updatesign:function(){
  170. if(this.valueLv!=this.oldvalueLv&&this.valueLv!="请选择签约等级"){
  171. this.SignlvUpdate();
  172. }
  173. if(this.address!=this.oldaddress&&this.address!="请选择地址"){
  174. this.AddressUpdate();
  175. }
  176. if(this.valueLv==this.oldvalueLv&&this.address==this.oldaddress){
  177. api.toast({
  178. msg: "请勿重复修改"
  179. });
  180. }
  181. if(this.valueLv=="请选择签约等级"&&this.address==this.oldaddress){
  182. api.toast({
  183. msg: "请勿重复修改"
  184. });
  185. }
  186. if(this.valueLv==this.oldvalueLv&&this.address=="请选择地址"){
  187. api.toast({
  188. msg: "请勿重复修改"
  189. });
  190. }
  191. if(this.valueLv=="请选择签约等级"&&this.address=="请选择地址"){
  192. api.toast({
  193. msg: "请按所需修订您的签约等级或地址后,再提交"
  194. });
  195. }
  196. },
  197. SignlvUpdate: function () {
  198. var _this = this,
  199. url = "SignlvUpdate",
  200. data = {
  201. "storeId": this.storeId,
  202. "numTask": this.numTask,
  203. "signLv": this.valueLv,
  204. "type": 'body',
  205. "url": 'json'
  206. }
  207. this.$post(url, data, function (ret) {
  208. if (ret.code == 0) {
  209. api.toast({
  210. msg: "修改成功"
  211. });
  212. setTimeout(function () {
  213. api.sendEvent({
  214. name: 'refushMeber',
  215. extra: {}
  216. });
  217. api.closeWin({});
  218. }, 1000);
  219. }
  220. });
  221. },
  222. AddressUpdate: function () {
  223. var _this = this,
  224. url = "updatesign",
  225. data = {
  226. "storeId": this.storeId,
  227. "jd": this.userlon,
  228. "wd": this.userLat,
  229. "province": this.province,
  230. "city": this.city,
  231. "district": this.district,
  232. "addressInfo": this.addressInfo,
  233. "type": 'body',
  234. "url": 'json'
  235. }
  236. this.$post(url, data, function (ret) {
  237. if (ret.code == 0) {
  238. api.toast({
  239. msg: "修改成功"
  240. });
  241. setTimeout(function () {
  242. api.sendEvent({
  243. name: 'refushMeber',
  244. extra: {}
  245. });
  246. api.closeWin({});
  247. }, 1000);
  248. }
  249. });
  250. },
  251. goMap: function () {
  252. this.goWin('map_win', 'map_win.html');
  253. },
  254. },
  255. mounted: function () {
  256. this.init();
  257. }
  258. })
  259. }
  260. </script>
  261. </html>