合同小程序前端代码仓库
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.

353 lines
7.2 KiB

  1. <template>
  2. <view class="container">
  3. <!-- 顶部标题 -->
  4. <view class="header">
  5. <view class="header_info">
  6. <text class="header_text" :title="title">{{title}}</text>
  7. <text style="margin-right: 10rpx; font-size: 40rpx;">|</text>
  8. <view @click="change_text" class="header_change">
  9. <text >切换</text>
  10. <uni-icons type="right" size="30" color="#c2d4de" :size="1"></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: 20rpx;">录入订单</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(ServiceName)" 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.name)">{{item.name}}</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 @click="close_view">好的</button>
  37. </view>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. export default {
  43. data() {
  44. return {
  45. ServiceName:'',
  46. title:"北京汽车有限公司",
  47. isshow:false,
  48. isshow_1:false,
  49. newListData:[],
  50. allMsg : [
  51. { name: "myhua", id: 1 },
  52. { name: "mp3", id: 2 },
  53. { name: "hello", id: 3 },
  54. { name: "world", id: 4 },
  55. { name: "warm weather", id: 5 },
  56. { name: "m3", id: 6 },
  57. { name: "hahaha", id: 7 }
  58. ],
  59. textcontent: [
  60. '公告1:欢迎使用车辆合同生成系统!',
  61. '公告2:请及时查看最新用户协议。',
  62. '公告3:隐私政策已更新,请知悉。',
  63. '公告1:欢迎使用车辆合同生成系统!',
  64. '公告2:请及时查看最新用户协议。',
  65. '公告3:隐私政策已更新,请知悉。'
  66. ],
  67. };
  68. },
  69. mounted() {
  70. this.allMsg = [
  71. { name: "myhua", id: 1 },
  72. { name: "mp3", id: 2 },
  73. { name: "hello", id: 3 },
  74. { name: "world", id: 4 },
  75. { name: "warm weather", id: 5 },
  76. { name: "m3", id: 6 },
  77. { name: "hahaha", id: 7 }
  78. ];
  79. this.textcontent = this.allMsg;
  80. },
  81. methods: {
  82. change_text(){
  83. if(this.isshow){
  84. this.isshow=false;
  85. }else{
  86. this.isshow=true;
  87. console.log('111')
  88. }
  89. },
  90. orderEntry(){
  91. console.log('111');
  92. uni.navigateTo(
  93. { url: '/pages/views/dingDanCreate' }
  94. )
  95. },
  96. // 搜索城市名字
  97. searchName(){
  98. },
  99. change_city(name){
  100. this.title = name;
  101. this.change_text();
  102. this.isshow_1 = true;
  103. },
  104. close_view(){
  105. this.isshow_1 = false;
  106. },
  107. // 模糊匹配
  108. // 右上角搜索框--模糊查询
  109. handleSearch(queryString) {
  110. if(event.target.value){
  111. let queryStringArr = event.target.value.split("");
  112. let str = "(.*?)";
  113. this.textcontent = [];
  114. let regStr = str + queryStringArr.join(str) + str;
  115. let reg = RegExp(regStr, "i"); // 以mh为例生成的正则表达式为/(.*?)m(.*?)h(.*?)/i
  116. this.allMsg.map(item => {
  117. if (reg.test(item.name)) {
  118. this.textcontent.push(item);
  119. }
  120. });
  121. }else {
  122. this.textcontent=[];
  123. this.textcontent = this.allMsg;
  124. }
  125. }
  126. }
  127. };
  128. </script>
  129. <style>
  130. .container {
  131. display: flex;
  132. flex-direction: column;
  133. height: 100vh;
  134. background-color: #f5f5f5;
  135. }
  136. /* 头部 */
  137. .header {
  138. padding: 20px;
  139. width: 100%;
  140. height: 15%;
  141. background-color: #044f7a;
  142. color: #fff;
  143. display: flex;
  144. flex-direction: row;
  145. align-items: center;
  146. }
  147. .header_info{
  148. width: 100%;
  149. display: flex;
  150. flex-direction: row;
  151. align-items: center;
  152. color: #e0e9ef;
  153. }
  154. .header_text{
  155. width: 45%;
  156. white-space: nowrap;/*设置不换行*/
  157. overflow: hidden; /*设置隐藏*/
  158. text-overflow: ellipsis; /*设置隐藏部分为省略号*/
  159. }
  160. .header_change{
  161. width: 100%;
  162. display: flex;
  163. flex-direction: row;
  164. align-items: center;
  165. }
  166. /* 订单录入 */
  167. .order_Entry_container{
  168. width: 90%;
  169. height: 8%;
  170. background-color: #d9e5eb;
  171. border-radius: 10rpx;
  172. left:5%;
  173. display: flex;
  174. flex-direction: row;
  175. align-items: center;
  176. margin-top: 10%;
  177. }
  178. .order_Entry_image{
  179. width: 10%;
  180. height: 70%;
  181. margin-left: 3%;
  182. }
  183. .order_Entry_end{
  184. margin-left: auto;
  185. margin-right: 7%;
  186. }
  187. /* 轮播图 */
  188. .swiper {
  189. height: 30%;
  190. width: 100%;
  191. display: flex;
  192. flex-direction: row;
  193. align-items: center;
  194. overflow: hidden;
  195. }
  196. .swiper-image {
  197. width: 100%;
  198. height: 100%;
  199. margin: 0 auto;
  200. }
  201. .form {
  202. flex: 1;
  203. padding: 20px;
  204. }
  205. .submit-button {
  206. width: 100%;
  207. height: 40px;
  208. background-color: #007aff;
  209. color: #fff;
  210. border: none;
  211. border-radius: 4px;
  212. font-size: 16px;
  213. }
  214. .footer {
  215. display: flex;
  216. justify-content: space-around;
  217. padding: 10px;
  218. background-color: #fff;
  219. border-top: 1px solid #ccc;
  220. }
  221. .nav-item {
  222. text-align: center;
  223. }
  224. .nav-item text {
  225. font-size: 14px;
  226. }
  227. .icon-image{
  228. width: 30%;
  229. height: 140px;
  230. margin: 0 auto;
  231. margin-top: 20px;
  232. }
  233. /* 遮罩层 */
  234. .show_container{
  235. width: 60%;
  236. height: 36%;
  237. background-color: #ffffff;
  238. position: absolute;
  239. border-radius: 20rpx;
  240. /* border: 1px solid; */
  241. box-shadow: 0px 3rpx 0px #e4e4e4;
  242. left:5%;
  243. top: 13%;
  244. z-index:999;
  245. display: flex;
  246. flex-direction: column;
  247. align-items: center;
  248. }
  249. .isshow-header{
  250. width: 90%;
  251. height: 30%;
  252. display: flex;
  253. justify-content: center;
  254. align-items: center;
  255. flex-direction: row;
  256. color: #3c7697;
  257. }
  258. .isshow-header-content-icon{
  259. width: 10%;
  260. height: 30%;
  261. }
  262. .isshow-header-content-input{
  263. width: 80%;
  264. height: 40%;
  265. margin: 0 20rpx 0 20rpx;
  266. border:none;
  267. outline:none;
  268. }
  269. .isshow-content{
  270. height: 70%;
  271. display: flex;
  272. flex-direction: column;
  273. align-items: center;
  274. overflow-y:scroll;
  275. }
  276. .isshow-content-text{
  277. color: #414141;
  278. height: 30rpx;
  279. width: 100%;
  280. line-height: 30rpx;
  281. margin: 20rpx 0 20rpx 0;
  282. font-size: 30rpx;
  283. }
  284. .isshow-content::-webkit-scrollbar {
  285. display: none;
  286. }
  287. /* 提示框*/
  288. .show_container_1{
  289. width: 80%;
  290. height: 40%;
  291. background-color: #ffffff;
  292. position: absolute;
  293. border-radius: 20rpx;
  294. /* border: 1px solid; */
  295. box-shadow: 0px 3rpx 0px #e4e4e4;
  296. left:10%;
  297. top: 30%;
  298. z-index:999;
  299. display: flex;
  300. flex-direction: column;
  301. align-items: center;
  302. }
  303. .show_container_1_image{
  304. height: 50%;
  305. width: 50%;
  306. top: 5%;
  307. }
  308. .show_container_1_footer{
  309. height: 50%;
  310. width: 100%;
  311. color:#0b5583;
  312. display: flex;
  313. flex-direction: column;
  314. align-items: center;
  315. font-weight: bold;
  316. font-size: 10rpx;
  317. }
  318. .show_container_1_footer text{
  319. margin-top: 10%;
  320. }
  321. .show_container_1_footer button{
  322. color:#0b5583;
  323. height: 30%;
  324. border-radius: 40rpx;
  325. width: 80%;
  326. margin-top: 5%;
  327. border: 1px solid #0c547e;
  328. display: flex;
  329. justify-content: center;
  330. align-items: center;
  331. }
  332. </style>