合同小程序前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

313 lines
6.2 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
  1. <template>
  2. <view class="container">
  3. <!-- 顶部标题 -->
  4. <view class="header">
  5. <view class="header_info">
  6. <text class="header_texts" :title="title">{{title}}</text>
  7. <text class="header_info_icon">|</text>
  8. <view @click="change_text" class="header_change">
  9. <text >切换</text>
  10. <uni-icons type="right" size="30" color="#c2d4de" ></uni-icons>
  11. </view>
  12. </view>
  13. </view>
  14. <view class="swiper">
  15. <image class="swiper-image" src="/static/image/组 71699.png"></image>
  16. </view>
  17. <view class="order_Entry_container" @click="orderEntry">
  18. <image class="order_Entry_image" src="/static/image/组 71699_1@3x.png"></image>
  19. <text style="color: #115881;font-weight: bold;margin-left: 1rem;">录入订单</text>
  20. <uni-icons class="order_Entry_end" type="right" :size="25" color="#306e91"></uni-icons>
  21. </view>
  22. <view v-if="isshow" class="show_container">
  23. <view class="isshow-header">
  24. <uni-icons class=" isshow-header-content-icon" type="search" :size="20"></uni-icons>
  25. <uni-easyinput :inputBorder="false" @input="handleSearch" class=" isshow-header-content-input" v-model="ServiceName" placeholder="请输入服务名称" />
  26. <text class="isshow-header-content-text" @click="searchName">搜索</text>
  27. </view>
  28. <view class="isshow-content" >
  29. <text class="isshow-content-text" v-for="(item, index) in textcontent" :key="index" @click="change_city(item.storeName)">{{item.storeName}}</text>
  30. </view>
  31. </view>
  32. <view v-if="isshow_1" class="show_container_1">
  33. <image class="show_container_1_image" src="/static/image/图层_6.png"></image>
  34. <view class="show_container_1_footer">
  35. <text>门店已经切换为{{title}}</text>
  36. <button class="show_container_1_footer_button" @click="close_view">好的</button>
  37. </view>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. import {getStoreName} from '@/api.uts'
  43. export default {
  44. data() {
  45. return {
  46. ServiceName:'',
  47. title:"北京汽车有限公司",
  48. isshow:false,
  49. isshow_1:false,
  50. newListData:[],
  51. textcontent: [],
  52. };
  53. },
  54. mounted() {
  55. getStoreName().then(
  56. (res)=>{
  57. getApp().allMsg=res.result;
  58. this.textcontent = res.result;
  59. this.title = res.result[0].storeName;
  60. getApp().storeName = res.result[0].storeName;
  61. console.log(getApp().storeName)
  62. }
  63. );
  64. },
  65. methods: {
  66. change_text(){
  67. if(this.isshow){
  68. this.isshow=false;
  69. }else{
  70. this.isshow=true;
  71. console.log('111')
  72. }
  73. },
  74. orderEntry(){
  75. console.log('111');
  76. uni.navigateTo(
  77. { url: '/pages/views/dingDanCreate' }
  78. )
  79. },
  80. // 搜索城市名字
  81. searchName(){
  82. if(this.ServiceName){
  83. this.textcontent = [];
  84. getApp().allMsg.map(item => {
  85. if (item.storeName.indexOf(this.ServiceName) !== -1) {
  86. this.textcontent.push(item);
  87. }
  88. });
  89. }else {
  90. this.textcontent=[];
  91. this.textcontent = getApp().allMsg;
  92. }
  93. },
  94. change_city(name){
  95. this.title = name;
  96. this.change_text();
  97. this.isshow_1 = true;
  98. getApp().storeName = this.title;
  99. },
  100. close_view(){
  101. this.isshow_1 = false;
  102. },
  103. // 模糊匹配
  104. // 右上角搜索框--模糊查询
  105. handleSearch(event) {
  106. console.log(event);
  107. if(event){
  108. this.textcontent = [];
  109. getApp().allMsg.map(item => {
  110. if (item.storeName.indexOf(event) !== -1) {
  111. this.textcontent.push(item);
  112. }
  113. });
  114. }else {
  115. this.textcontent=[];
  116. this.textcontent = getApp().allMsg;
  117. }
  118. }
  119. }
  120. };
  121. </script>
  122. <style>
  123. /* 订单录入 */
  124. .order_Entry_container{
  125. width: 90%;
  126. height: 8%;
  127. background-color: #d9e5eb;
  128. border-radius: 0.6rem;
  129. margin-left:5%;
  130. display: flex;
  131. flex-direction: row;
  132. align-items: center;
  133. margin-top: 10%;
  134. }
  135. .order_Entry_image{
  136. width: 10%;
  137. height: 70%;
  138. margin-left: 3%;
  139. }
  140. .order_Entry_end{
  141. margin-left: auto;
  142. margin-right: 7%;
  143. }
  144. /* 轮播图 */
  145. .swiper {
  146. height: 30%;
  147. width: 100%;
  148. display: flex;
  149. flex-direction: row;
  150. align-items: center;
  151. overflow: hidden;
  152. }
  153. .swiper-image {
  154. width: 100%;
  155. height: 100%;
  156. margin: 0 auto;
  157. }
  158. .form {
  159. flex: 1;
  160. padding: 1rem;
  161. }
  162. .submit-button {
  163. width: 100%;
  164. height: 3rem;
  165. background-color: #007aff;
  166. color: #fff;
  167. border: none;
  168. border-radius: 0.3rem;
  169. font-size: 1rem;
  170. }
  171. .footer {
  172. display: flex;
  173. justify-content: space-around;
  174. padding: 0.8rem;
  175. background-color: #fff;
  176. border-top: 1rem solid #ccc;
  177. }
  178. .nav-item {
  179. text-align: center;
  180. }
  181. .nav-item text {
  182. font-size: 0.9rem;
  183. }
  184. .icon-image{
  185. width: 30%;
  186. height: 10rem;
  187. margin: 0 auto;
  188. margin-top: 1rem;
  189. }
  190. /* 遮罩层 */
  191. .show_container{
  192. width: 60%;
  193. height: 36%;
  194. background-color: #ffffff;
  195. position: absolute;
  196. border-radius: 1rem;
  197. /* border: 1rem solid; */
  198. box-shadow: 0rem 0.2rem 0rem #e4e4e4;
  199. left:5%;
  200. top: 13%;
  201. z-index:999;
  202. display: flex;
  203. flex-direction: column;
  204. align-items: center;
  205. }
  206. .isshow-header{
  207. width: 90%;
  208. height: 30%;
  209. display: flex;
  210. justify-content: center;
  211. align-items: center;
  212. flex-direction: row;
  213. color: #3c7697;
  214. }
  215. .isshow-header-content-icon{
  216. width: 10%;
  217. height: 30%;
  218. }
  219. .isshow-header-content-input{
  220. width: 80%;
  221. height: 40%;
  222. margin: 0 1rem 0 1rem;
  223. border:none;
  224. outline:none;
  225. }
  226. .isshow-content{
  227. height: 70%;
  228. display: flex;
  229. flex-direction: column;
  230. align-items: center;
  231. overflow-y:scroll;
  232. }
  233. .isshow-content-text{
  234. color: #414141;
  235. height: 1.5rem;
  236. width: 100%;
  237. line-height: 1.5rem;
  238. margin: 1rem 0 1rem 0;
  239. font-size: 0.8rem;
  240. }
  241. .isshow-content::-webkit-scrollbar {
  242. display: none;
  243. }
  244. /* 提示框*/
  245. .show_container_1{
  246. width: 80%;
  247. height: 50%;
  248. background-color: #ffffff;
  249. position: absolute;
  250. border-radius: 1rem;
  251. /* border: 1rem solid; */
  252. box-shadow: 0rem 0.2rem 0rem #e4e4e4;
  253. left:10%;
  254. top:25%;
  255. z-index:999;
  256. display: flex;
  257. flex-direction: column;
  258. align-items: center;
  259. }
  260. .show_container_1_image{
  261. height: 40%;
  262. width: 60%;
  263. top: 5%;
  264. }
  265. .show_container_1_footer{
  266. height: 50%;
  267. width: 100%;
  268. color:#0b5583;
  269. display: flex;
  270. flex-direction: column;
  271. align-items: center;
  272. font-weight: bold;
  273. font-size: 0.7rem;
  274. }
  275. .show_container_1_footer text{
  276. margin-top: 10%;
  277. }
  278. .show_container_1_footer_button{
  279. background-color: #ffffff;
  280. color:#0b5583;
  281. height: 30%;
  282. border-radius: 1.8rem;
  283. width: 80%;
  284. margin-top: 5%;
  285. border: 0.1rem solid #0c547e;
  286. display: flex;
  287. justify-content: center;
  288. align-items: center;
  289. }
  290. </style>