sign_address.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  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">
  38. <div :style="{ color:titleStyle}">{{valueLv}}</div>
  39. </van-cell>
  40. <van-cell is-link v-on:click="goMap" v-if="addressModify==0">{{address}}</van-cell>
  41. <van-popup v-model="showPicker" position="bottom" :style="{ height: '30%' }">
  42. <van-picker title="签约等级" show-toolbar v-bind:columns="signList" value-key="signLv"
  43. v-on:cancel="onCancel" v-on:confirm="onConfirm" />
  44. </van-popup>
  45. <div style="background-color: #fff;margin: .2rem;padding: .2rem;border-radius: .2rem;" v-html="text">
  46. </div>
  47. </div>
  48. </div>
  49. </body>
  50. <link rel="stylesheet" href="./mescroll/mescroll.min.css">
  51. <script type="text/javascript" src="./js/qrcode.min.js"></script>
  52. <script type="text/javascript" src="../script/aui-scroll.js"></script>
  53. <script type="text/javascript" src="./mescroll/mescroll.min.js"></script>
  54. <script type="text/javascript" src="../script/api.js"></script>
  55. <script type="text/javascript" src="../script/httpRequest.js"></script>
  56. <script type="text/javascript" src="../script/vue_plugins.js"></script>
  57. <script type="text/javascript">
  58. function closeWin() {
  59. api.closeWin({});
  60. }
  61. apiready = function () {
  62. var addressModify = api.pageParam.addressModify;
  63. var contractTask = api.pageParam.contractTask
  64. api.parseTapmode();
  65. var header = $api.byId('aui-header');
  66. $api.fixStatusBar(header);
  67. new Vue({
  68. el: '#app',
  69. data: {
  70. showPicker: false,
  71. signList: [],
  72. valueLv: "请选择签约等级",
  73. userDistrct: '',
  74. address: '请选择地址',
  75. addressModify: addressModify,
  76. contractTask: contractTask,
  77. SingLvStatus: false,
  78. titleStyle: "#000",
  79. text:"",
  80. },
  81. methods: {
  82. init: function () {
  83. this.storeId = $api.getStorage('userid');
  84. this.SignlvList();
  85. this.getsignAddress();
  86. var _this = this;
  87. this.addEvent('chooseDistict', function (ret) {
  88. if (ret) {
  89. _this.userDistrct = ret.value.p + ret.value.c + ret.value.d;
  90. _this.userAddress = ret.value.a;
  91. _this.userLat = ret.value.lat;
  92. _this.userlon = ret.value.lon;
  93. _this.address = _this.userDistrct + _this.userAddress;
  94. _this.province = ret.value.p
  95. _this.city = ret.value.c
  96. _this.district = ret.value.d
  97. _this.addressInfo = ret.value.a
  98. }
  99. api.closeWin({
  100. name: 'map_win'
  101. });
  102. })
  103. this.getStoreSignMessage()
  104. },
  105. onCancel: function () {
  106. this.showPicker = false;
  107. },
  108. getSignLv: function () {
  109. if (this.SingLvStatus) {
  110. api.toast({
  111. msg: "本次签约任务已修改,请勿重复修改"
  112. });
  113. return
  114. }
  115. this.showPicker = true;
  116. var url = "getSignLvU",
  117. _this = this;
  118. this.$post(url, {
  119. "status": 0,
  120. url: "json",
  121. type: 'body'
  122. }, function (ret) {
  123. if (ret.code == 0 || ret.code == '0') {
  124. _this.signList = ret.date;
  125. }
  126. })
  127. },
  128. onConfirm: function (value) {
  129. this.valueLv = value.signLv;
  130. this.numTask = value.numTask;
  131. this.showPicker = false;
  132. },
  133. SignlvList: function () {
  134. var _this = this,
  135. url = "SignlvList",
  136. data = {
  137. "STORE_ID": this.storeId,
  138. "IS_DELETE": 0,
  139. "type": 'body',
  140. "url": 'json'
  141. }
  142. this.$post(url, data, function (ret) {
  143. if (ret.code == 0) {
  144. if (ret.list.length != 0&&ret.list[0].signLv!=null) {
  145. _this.valueLv = ret.list[0].signLv;
  146. _this.numTask = ret.list[0].numTask;
  147. // _this.titleStyle = "#969799"
  148. _this.SingLvStatus = true
  149. _this.oldvalueLv = ret.list[0].signLv;
  150. } else {
  151. _this.valueLv = "请选择签约等级"
  152. }
  153. }
  154. });
  155. },
  156. getsignAddress: function () {
  157. var _this = this,
  158. url = "getsignAddress",
  159. data = {
  160. "STORE_ID": this.storeId,
  161. "IS_DELETE": 0,
  162. "type": 'body',
  163. "url": 'json'
  164. }
  165. this.$post(url, data, function (ret) {
  166. if (ret.code == 0) {
  167. if (ret.list.length != 0) {
  168. _this.address = ret.list[0].province + ret.list[0].city + ret.list[0].district + ret.list[0].addressInfo;
  169. if (!_this.address) {
  170. _this.address = "请选择地址"
  171. }
  172. _this.oldaddress = ret.list[0].province + ret.list[0].city + ret.list[0].district + ret.list[0].addressInfo;
  173. var reg = new RegExp("null", "g");
  174. _this.address = _this.address.replace(reg, "")
  175. }
  176. }
  177. });
  178. },
  179. updatesign: function () {
  180. // if (this.valueLv == "请选择签约等级"&&contractTask==0) {
  181. // api.toast({
  182. // msg: "请按所需修订您的签约等级,再提交"
  183. // });
  184. // return
  185. // }
  186. // if (this.address == "请选择地址"&&addressModify==0) {
  187. // api.toast({
  188. // msg: "请按所需修订您的地址后,再提交"
  189. // });
  190. // return
  191. // }
  192. if (this.valueLv != this.oldvalueLv && this.valueLv != "请选择签约等级") {
  193. this.SignlvUpdate();
  194. }
  195. if (this.address != this.oldaddress && this.address != "请选择地址") {
  196. this.AddressUpdate();
  197. }
  198. },
  199. SignlvUpdate: function () {
  200. var _this = this,
  201. url = "SignlvUpdate",
  202. data = {
  203. "storeId": this.storeId,
  204. "numTask": this.numTask,
  205. "signLv": this.valueLv,
  206. "type": 'body',
  207. "url": 'json'
  208. }
  209. this.$post(url, data, function (ret) {
  210. if (ret.code == 0) {
  211. api.toast({
  212. msg: "修改成功"
  213. });
  214. setTimeout(function () {
  215. api.sendEvent({
  216. name: 'refushMeber',
  217. extra: {}
  218. });
  219. api.closeWin({});
  220. }, 1000);
  221. }
  222. });
  223. },
  224. AddressUpdate: function () {
  225. var _this = this,
  226. url = "updatesign",
  227. data = {
  228. "storeId": this.storeId,
  229. "jd": this.userlon,
  230. "wd": this.userLat,
  231. "province": this.province,
  232. "city": this.city,
  233. "district": this.district,
  234. "addressInfo": this.addressInfo,
  235. "type": 'body',
  236. "url": 'json'
  237. }
  238. this.$post(url, data, function (ret) {
  239. if (ret.code == 0) {
  240. api.toast({
  241. msg: "修改成功"
  242. });
  243. setTimeout(function () {
  244. api.sendEvent({
  245. name: 'refushMeber',
  246. extra: {}
  247. });
  248. api.closeWin({});
  249. }, 1000);
  250. }
  251. });
  252. },
  253. getStoreSignMessage: function () {
  254. var _this = this,
  255. url = "getStoreSignMessage",
  256. data = ""
  257. this.$get(url, data, function (ret) {
  258. if (ret.code == 0) {
  259. _this.text=ret.message.replace(/\\n/g, "<br>")
  260. }
  261. });
  262. },
  263. goMap: function () {
  264. this.goWin('map_win', 'map_win.html');
  265. },
  266. },
  267. mounted: function () {
  268. this.init();
  269. }
  270. })
  271. }
  272. </script>
  273. </html>