check_apply.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. {include file="public/head"}
  5. <link href="/system/frame/css/bootstrap.min.css?v=3.4.0" rel="stylesheet">
  6. <link href="/system/frame/css/style.min.css?v=3.0.0" rel="stylesheet">
  7. <title>{$title|default=''}</title>
  8. <style></style>
  9. </head>
  10. <body>
  11. <div class="wrapper wrapper-content">
  12. <div class="row">
  13. <div class="col-sm-12">
  14. <div class="ibox float-e-margins">
  15. <div class="ibox-title">
  16. <h5>门店设置</h5>
  17. </div>
  18. <div id="store-attr" class="mp-form" v-cloak="">
  19. <i-Form :label-width="80" style="width: 100%">
  20. <template>
  21. <Alert type="warning">除门店简介外其他选项都是必填项</Alert>
  22. <Form-Item>
  23. <Row>
  24. <i-Col span="13">
  25. <span>门店名称:</span>
  26. <i-Input placeholder="门店名称" v-model="form.name" style="width: 80%"
  27. type="text"></i-Input>
  28. </i-Col>
  29. </Row>
  30. </Form-Item>
  31. <Form-Item>
  32. <Row>
  33. <i-Col span="13">
  34. <span>门店简介:</span>
  35. <i-Input placeholder="门店简介" v-model="form.introduction" style="width: 80%"
  36. type="text"></i-Input>
  37. </i-Col>
  38. </Row>
  39. </Form-Item>
  40. <Form-Item>
  41. <Row>
  42. <i-Col span="13">
  43. <span>门店手机号:</span>
  44. <i-Input placeholder="门店手机号" v-model="form.phone" style="width: 80%"
  45. type="text"></i-Input>
  46. </i-Col>
  47. </Row>
  48. </Form-Item>
  49. <Form-Item>
  50. <Row>
  51. <i-Col span="13">
  52. <span>门店地址:</span>
  53. <Cascader :data="addresData" :value.sync="form.address"
  54. @on-change="handleChange"
  55. style="width: 80%;display: inline-block;"></Cascader>
  56. </i-Col>
  57. </Row>
  58. </Form-Item>
  59. <Form-Item>
  60. <Row>
  61. <i-Col span="13">
  62. <span>详细地址:</span>
  63. <i-Input placeholder="详细地址" v-model="form.detailed_address" style="width: 80%"
  64. type="text"></i-Input>
  65. </i-Col>
  66. </Row>
  67. </Form-Item>
  68. <!-- <Form-Item>-->
  69. <!-- <Row>-->
  70. <!-- <i-Col span="13">-->
  71. <!-- <span>核销时效:</span>-->
  72. <!-- <Date-picker type="daterange" @on-change="changeValidTime" placeholder="选择日期" :value="form.valid_time"></Date-picker>-->
  73. <!-- </i-Col>-->
  74. <!-- </Row>-->
  75. <!-- </Form-Item>-->
  76. <Form-Item>
  77. <Row>
  78. <i-Col span="13">
  79. <span>营业时间:</span>
  80. <Time-picker type="timerange" @on-change="changeDayTime" placement="bottom-end"
  81. :value="form.day_time" placeholder="选择时间"></Time-picker>
  82. </i-Col>
  83. </Row>
  84. </Form-Item>
  85. <Form-Item>
  86. <Row>
  87. <i-Col span="13">
  88. <span>门店logo:</span>
  89. <div class="demo-upload-list" v-if="form.image">
  90. <template>
  91. <img :src="form.image">
  92. <div class="demo-upload-list-cover">
  93. <Icon type="ios-eye-outline" @click="visible = true "></Icon>
  94. <Icon type="ios-trash-outline" @click="form.image=''"></Icon>
  95. </div>
  96. </template>
  97. </div>
  98. <div class="ivu-upload" style="display: inline-block; width: 58px;"
  99. @click="openWindows('选择图片','{:Url('widget.images/index',['fodder'=>'image'])}',{w:900,h:550})"
  100. v-if="!form.image">
  101. <div class="ivu-upload ivu-upload-drag">
  102. <div style="width: 58px; height: 58px; line-height: 58px;">
  103. <i class="ivu-icon ivu-icon-camera" style="font-size: 20px;"></i>
  104. </div>
  105. </div>
  106. </div>
  107. <div style="width: 670px; height: 320px;bottom:10%;display: block; position: absolute;z-index: 999999"
  108. v-if="visible" @click="visible = false ">
  109. <img :src="form.image"
  110. style="max-width: 100%;max-height: 100%;width:auto;height:auto;position: absolute;left: 50%;top: 50%;transform: translate3d(-50%,-50%,0);-webkit-transform: translate3d(-50%,-50%,0);">
  111. </div>
  112. </i-Col>
  113. </Row>
  114. </Form-Item>
  115. <Form-Item>
  116. <Row>
  117. <i-Col span="13">
  118. <span style="float: left">经纬度:</span>
  119. <Tooltip content="请点击查找位置进行选择位置">
  120. <i-Input placeholder="经纬度" v-model="form.latlng" :readonly="true"
  121. style="width: 80%">
  122. <span slot="append"
  123. @click="openWindows('查找位置','{:Url('select_address')}',{w:400,h:700})"
  124. style="cursor:pointer">查找位置</span>
  125. </i-Input>
  126. </Tooltip>
  127. </i-Col>
  128. </Row>
  129. </Form-Item>
  130. <Form-Item>
  131. <Row>
  132. <i-Col span="13">
  133. <span>终端号:</span>
  134. <i-Input placeholder="终端号" v-model="form.terminal_number" style="width: 80%"
  135. type="text"></i-Input>
  136. </i-Col>
  137. </Row>
  138. </Form-Item>
  139. <Form-Item>
  140. <Row>
  141. <i-Col span="13">
  142. <span>店长用户编号:</span>
  143. <i-Input placeholder="店长用户编号" v-model="form.uid" style="width: 80%"
  144. type="text"></i-Input>
  145. </i-Col>
  146. </Row>
  147. </Form-Item>
  148. <Form-Item>
  149. <Row>
  150. <i-Col span="13">
  151. <span>第三方门店:</span>
  152. <i-Select v-model="form.is_triple" style="width: 80%">
  153. <i-Option value="1">是</i-Option>
  154. <i-Option value="0">否</i-Option>
  155. </i-Select>
  156. </i-Col>
  157. </Row>
  158. </Form-Item>
  159. <Form-Item>
  160. <Row>
  161. <i-Col span="13">
  162. <span>推荐奖:</span>
  163. <i-Input placeholder="%" v-model="form.recommend" style="width: 80%"
  164. type="text"></i-Input>
  165. </i-Col>
  166. </Row>
  167. </Form-Item>
  168. <Form-Item>
  169. <Row>
  170. <i-Col span="13">
  171. <span>订单手续费:</span>
  172. <i-Input placeholder="%" v-model="form.commission_order" style="width: 80%"
  173. type="text"></i-Input>
  174. </i-Col>
  175. </Row>
  176. </Form-Item> <Form-Item>
  177. <Row>
  178. <i-Col span="13">
  179. <span>提现手续费:</span>
  180. <i-Input placeholder="%" v-model="form.commission" style="width: 80%"
  181. type="text"></i-Input>
  182. </i-Col>
  183. </Row>
  184. </Form-Item>
  185. <Form-Item>
  186. <Row>
  187. <i-Col span="13">
  188. <span>推荐用户:</span>
  189. <i-Select v-model="form.spread_uid" style="width: 80%">
  190. <i-Option v-for="item in userData" :value="item.uid">{{item.nickname}}({{item.phone}})</i-Option>
  191. </i-Select>
  192. </i-Col>
  193. </Row>
  194. </Form-Item>
  195. </template>
  196. <Form-Item>
  197. <Row>
  198. <i-Col span="8" offset="6">
  199. <i-Button type="primary" @click="submit">提交</i-Button>
  200. </i-Col>
  201. </Row>
  202. </Form-Item>
  203. </i-Form>
  204. </div>
  205. </div>
  206. </div>
  207. </div>
  208. </div>
  209. <script src="{__PLUG_PATH}city.js"></script>
  210. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  211. <script>
  212. var storeData = {:json_encode($store)};
  213. var userData = {:json_encode($users)};
  214. mpFrame.start(function (Vue) {
  215. $.each(city, function (key, item) {
  216. city[key].value = item.label;
  217. if (item.children && item.children.length) {
  218. $.each(item.children, function (i, v) {
  219. city[key].children[i].value = v.label;
  220. if (v.children && v.children.length) {
  221. $.each(v.children, function (k, val) {
  222. city[key].children[i].children[k].value = val.label;
  223. });
  224. }
  225. });
  226. }
  227. });
  228. new Vue({
  229. data: function () {
  230. return {
  231. id: storeData.id || 0,
  232. addresData: city,
  233. form: {
  234. name: storeData.name || '',
  235. introduction: storeData.introduction || '',
  236. phone: storeData.phone || '',
  237. address: storeData.address || [],
  238. image: storeData.image || '',
  239. detailed_address: storeData.detailed_address || '',
  240. latlng: storeData.latlng || '',
  241. valid_time: storeData.valid_time || [],
  242. day_time: storeData.day_time || [],
  243. terminal_number: storeData.terminal_number || '',
  244. uid: storeData.uid || 0,
  245. commission: storeData.commission || 0,
  246. commission_order: storeData.commission_order || 0,
  247. recommend: storeData.recommend || 0,
  248. spread_uid: storeData.spread_uid || 0,
  249. is_triple: storeData.is_triple || "0",
  250. },
  251. visible: false,
  252. }
  253. },
  254. methods: {
  255. changeModel(newval) {
  256. console.log(newval);
  257. },
  258. changeDayTime: function (date) {
  259. this.$set(this.form, 'day_time', date);
  260. },
  261. changeValidTime: function (date) {
  262. this.$set(this.form, 'valid_time', date);
  263. },
  264. createFrame: function (title, src, opt) {
  265. opt === undefined && (opt = {});
  266. var h = parent.document.body.clientHeight - 100;
  267. return layer.open({
  268. type: 2,
  269. title: title,
  270. area: [(opt.w || 700) + 'px', (opt.h || h) + 'px'],
  271. fixed: false, //不固定
  272. maxmin: true,
  273. moveOut: false,//true 可以拖出窗外 false 只能在窗内拖
  274. anim: 5,//出场动画 isOutAnim bool 关闭动画
  275. offset: 'auto',//['100px','100px'],//'auto',//初始位置 ['100px','100px'] t[ 上 左]
  276. shade: 0,//遮罩
  277. resize: true,//是否允许拉伸
  278. content: src,//内容
  279. move: '.layui-layer-title'
  280. });
  281. },
  282. handleChange: function (value, selectedData) {
  283. var that = this;
  284. that.form.address = [];
  285. $.each(selectedData, function (key, item) {
  286. that.form.address.push(item.label);
  287. });
  288. that.$set(that.form, 'address', that.form.address);
  289. },
  290. openWindows: function (title, url, opt) {
  291. return this.createFrame(title, url, opt);
  292. },
  293. changeIMG: function (name, url) {
  294. this.form[name] = url;
  295. },
  296. isPhone: function (test) {
  297. var reg = /^1[3456789]\d{9}$/;
  298. return reg.test(test);
  299. },
  300. submit: function () {
  301. var that = this;
  302. if (!that.form.name) return $eb.message('error', '请填写门店行名称');
  303. if (!that.form.phone) return $eb.message('error', '请输入手机号码');
  304. if (!that.isPhone(that.form.phone)) return $eb.message('error', '请输入正确的手机号码');
  305. if (!that.form.address) return $eb.message('error', '请选择门店地址');
  306. if (!that.form.detailed_address) return $eb.message('error', '请填写门店详细地址');
  307. if (!that.form.image) return $eb.message('error', '请选择门店logo');
  308. if (!that.form.valid_time) return $eb.message('error', '请选择核销时效');
  309. if (!that.form.day_time) return $eb.message('error', '请选择门店营业时间');
  310. if (!that.form.latlng) return $eb.message('error', '请选择门店经纬度!');
  311. var index = layer.load(1, {
  312. shade: [0.5, '#fff']
  313. });
  314. $eb.axios.post('{:Url("save")}' + (that.id ? '?id=' + that.id : ''), that.form).then(function (res) {
  315. layer.close(index);
  316. layer.msg(res.data.msg);
  317. if (res.data.data.id) that.id = res.data.data.id;
  318. }).catch(function (err) {
  319. console.log(err);
  320. layer.close(index);
  321. })
  322. },
  323. selectAdderss: function (data) {
  324. //lat 纬度 lng 经度
  325. this.form.latlng = data.latlng.lat + ',' + data.latlng.lng;
  326. }
  327. },
  328. mounted: function () {
  329. window.changeIMG = this.changeIMG;
  330. window.selectAdderss = this.selectAdderss;
  331. }
  332. }).$mount(document.getElementById('store-attr'))
  333. })
  334. </script>